2

I have installed firebase dynamic links in my Flutter app, configured it on iOS native side with adding GoogleService-Info.plist for every env, have set DYNAMIC_URL and in general all dynamic links work good.

Except only one case: for ONLY FIRST RUN in release mode (or from TestFlight) FirebaseDynamicLinks.instance.getInitialLink() returns null.

I install the app on real device in release mode, I don't open it automatically from IDLE, I am scanning dynamic link QR from camera or clicking on it itself - FIRST TIME app doesn't handle the link and this is the issue! Every next time app is able to handle the link properly from completely closed state (when it's running in a background it every time works with onLink).

I tried delays for function start, checked all that code, asked colleagues - freaking nightmare

1 Answer 1

0

Forgot to post a solution...

I found a way around to resolve this issue:

final clipboardData = await Clipboard.getData('text/plain');
if (clipboardData?.text != null) {
  final uri = Uri.tryParse(clipboardData!.text!);
  if (uri != null) {
     final link = uri.queryParameters['link'];
     if (link != null) {
        final linkUri = Uri.tryParse(link);
        if (linkUri != null) {
           await _handleDeepLink(linkUri);
        }
     }
  }
}

I use it on first run if initial link is null.

Ugly, but works

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.