firebase/quickstart-cpp

Dynamic Links C++ SDK crash on iOS when opening the app with a Dynamic Link

ForestRingGames opened this issue · 5 comments

Hello Firebase-Team,

We've just faced a crash in our app after clicking on a dynamic link. The crash seems to happen inside the Firebase library. Attached you find a crash-screenshot with a stacktrace.

bildschirmfoto 2018-01-28 um 19 11 12

Thanks for posting this! We'll investigate and report back ASAP.

Hi @ForestRingGames , we tracked this down to the error reporting path of the Dynamic Links iOS library. In the case where you use a custom URI scheme and the URI scheme (e.g my.cool.app://) mismatches the bundle ID of your application (e.g my.cool.apps://), the iOS Dynamic Links library will call the completion block in of FIRDynamicLinks:handleUniversalLink:completion: with a nil NSError and a nil FIRDynamicLink i.e in the following code dynamic_link and error end up both being nil as it can't parse the link...

[[FIRDynamicLinks dynamicLinks] handleUniversalLink:url
                                         completion:^(FIRDynamicLink *_Nullable dynamic_link, NSError *_Nullable error) {
    // completion logic
  }];

the code in the C++ iOS library incorrectly assumed that if error is nil then dynamic_link would be non-nil, bad assumption. We have a fix lined up for our next release. In the meantime if you're using custom schemes you'll need to wait for our release as we'll end up trying to decode them via dynamic links and hit this error. Otherwise, you should check your application for custom scheme handlers, this page describes where this located in Xcode.

@stewartmiles Thank you that's awesome that you found out something! :)

So that means - after the next release this will not happen again, right? Regardless of what URI types, we've been using now?
Do you already have an estimate when the build will be out and/or do you have some kind of email notification that I can sign up for to definitely know I need to update now? :)

@ForestRingGames the build is likely to land next week. Alas, we don't have a way to subscribe for new release updates 👎. But what we - the team - do is go through all resolved issues on public forums like this (firebase-talk@ etc.) and post when we have a release that resolves an issue. So hang out on this thread and we'll send a follow up when a new release is posted on https://firebase.google.com/support/release-notes/cpp-relnotes