React-native-firebase: Not receiving Dynamic Link when app is installed from the appstore

Created on 3 Dec 2017  路  22Comments  路  Source: invertase/react-native-firebase

Issue

I followed your setup guide and adapted AppDelegate.m accordingly. Dynamic Links are working if the app is already installed, but when the app is installed from the appstore, I do not receive the dynamic link. Instead I get the following link: [CUSTOM_SCHEME]://google/link/?dismiss=1&is_weak_match=1 which indicates that FDL is working correctly but could not extract any dynamic link.

Probably closely related to: https://github.com/firebase/firebase-ios-sdk/issues/233

Environment

I am currently testing this by uninstalling the app on the device -> clicking the dynamic link -> redirects to the appstore -> install the app from xcode.


1. Application Target Platform:
* iOS


2. Development Operating System:
* macOS 10.11.6


3. Build Tools:
* Xcode 8.2.1
* iOS 10.2.1


4. React Native version:
* [email protected]

  1. Firebase Module:
  2. [email protected]

Podfile.lock

PODS:
  - Firebase/Core (4.7.0):
    - FirebaseAnalytics (= 4.0.5)
    - FirebaseCore (= 4.0.12)
  - Firebase/DynamicLinks (4.7.0):
    - Firebase/Core
    - FirebaseDynamicLinks (= 2.3.0)
  - Firebase/Messaging (4.7.0):
    - Firebase/Core
    - FirebaseMessaging (= 2.0.7)
  - FirebaseAnalytics (4.0.5):
    - FirebaseCore (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
    - nanopb (~> 0.3)
  - FirebaseCore (4.0.12):
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
  - FirebaseDynamicLinks (2.3.0):
    - FirebaseAnalytics (~> 4.0)
  - FirebaseInstanceID (2.0.7)
  - FirebaseMessaging (2.0.7):
    - FirebaseAnalytics (~> 4.0)
    - FirebaseCore (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - GoogleToolboxForMac/Logger (~> 2.1)
    - Protobuf (~> 3.1)
  - Flurry-iOS-SDK/FlurrySDK (7.10.0)
  - GoogleToolboxForMac/Defines (2.1.3)
  - GoogleToolboxForMac/Logger (2.1.3):
    - GoogleToolboxForMac/Defines (= 2.1.3)
  - GoogleToolboxForMac/NSData+zlib (2.1.3):
    - GoogleToolboxForMac/Defines (= 2.1.3)
  - nanopb (0.3.8):
    - nanopb/decode (= 0.3.8)
    - nanopb/encode (= 0.3.8)
  - nanopb/decode (0.3.8)
  - nanopb/encode (0.3.8)
  - Protobuf (3.5.0)
  - ShoutemFirebase (0.0.1):
    - Firebase/Messaging
  - ShoutemFlurryAnalytics (0.0.1):
    - Flurry-iOS-SDK/FlurrySDK

DEPENDENCIES:
  - Firebase/Core
  - Firebase/DynamicLinks
  - ShoutemFirebase (from `../node_modules/shoutem.firebase/ShoutemFirebase.podspec`)
  - ShoutemFlurryAnalytics (from `../node_modules/shoutem.flurry-analytics/ShoutemFlurryAnalytics.podspec`)

EXTERNAL SOURCES:
  ShoutemFirebase:
    :path: "../node_modules/shoutem.firebase/ShoutemFirebase.podspec"
  ShoutemFlurryAnalytics:
    :path: "../node_modules/shoutem.flurry-analytics/ShoutemFlurryAnalytics.podspec"

SPEC CHECKSUMS:
  Firebase: dbfb98ccec2dcfcd21ab9cc1b4981a3f3c8c5e26
  FirebaseAnalytics: 5b02a63ead2c3f0259cfc7f15e053e440587ecf8
  FirebaseCore: 6cf108b63997bc08c04a1ffa55a3ac0d71a59ffc
  FirebaseDynamicLinks: b75f5b4dcfc3c9b7889e1283632359e5431264e7
  FirebaseInstanceID: 148c25c986c8699e67304b114e365713dce467f2
  FirebaseMessaging: 1a11d1c0a9ed9b3f75a0685bb0ae5932e1062f5f
  Flurry-iOS-SDK: e6975df9e57010d582bf9bed0f6312553cf24bc2
  GoogleToolboxForMac: 2501e2ad72a52eb3dfe7bd9aee7dad11b858bd20
  nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
  Protobuf: 8a9838fba8dae3389230e1b7f8c104aa32389c03
  ShoutemFirebase: e17b35af2bd18830782e44d9c1e54810905bb784
  ShoutemFlurryAnalytics: d221e35959107eae5c1fc0b6f0a915e1b4fa0cb5

PODFILE CHECKSUM: 451fdf3d120f58853b797312e12f20e5f5a4b761

COCOAPODS: 1.1.1
iOS Links Firebase Waiting for User Response

Most helpful comment

+1 on this issue. Seem to be having a hard time getting initial link to persist after App Store download.

All 22 comments

_?dismiss=1&is_weak_match=1_ means that Firebase could not figure out which Dynamic Link was clicked to install the app using its probabilistic device matching.

I would suggest debugging on a real device via cellular data. (This makes the device more unique and will help Google's probability based device matching)

Upon further investigation it appears _getInitialLink()_ is not getting the initial link after an install due to Firebase Library simulating the open by calling the iOS openURL delegate.

Since the app was not "actually" opened from the link. (It was installed then opened)
Thus _self.bridge.launchOptions[UIApplicationLaunchOptionsURLKey]_ is not set.

I am pretty bad at Objective C but I made a pull request for what I have that is working.
https://github.com/invertase/react-native-firebase/pull/664

@Codeseer Thanks for the PR, @seblau can you try this out?

I can not confirm this fix. Now its assigning the dismiss url to the new installLink variable. This also results in an empty getInitialLink.

screen shot 2017-12-04 at 23 50 54

Looks like the install issue @Codeseer had is unrelated to this one actually (I jumped ahead a bit sorry, it's late 馃槾 ), this does seem to be in relation to the ios-sdk issue as you linked (it is what we use under the hood after all).

The snippet @OleksiyA provided in that issue is pretty much what we do internally: https://github.com/invertase/react-native-firebase/blob/master/ios/RNFirebase/links/RNFirebaseLinks.m#L53 Also have you tried lowering the SDK version to 4.0.4 - some people suggesting it works in that version - though it's not really a 'fix'.

Perhaps @OleksiyA can provide some insight?

@Codeseer - your PR should probably be checking the contents of the url i.e. is it an install url in this case if possible - to avoid what's happening in the above screenshot - could you also submit it again as well please :)

@Salakar @seblau Firebase will always call the openUrl delegate regardless of if the app was installed from a link on first open. When the url includes the dismiss=1 param it will resolve to a null dynamic link (because app was not installed from a valid dynamic link)

I think a better name for the variable would be initialLink instead of installLink
Will submit a PR soon.

If you are getting dismiss=1 it means google is not matching your device correctly.
I would suggest switching to cellular (low traffic unique IP) and testing on a real device.

This video explains how that match confidence works.
https://youtu.be/sFPo296OQqk?t=14m23s

Also might be a good idea to add the matchConfidence as a parameter for the event and getInitialLink but that seems somewhat outside the scope of this specific issue.

+1 ! works fine on Android. Don't receive my link on iOS.

I think what @Codeseer fixing here is the deferred deep linking (aka. pending deep linking) on ios. ios never process the deferred deep linking because only applicaIon: openURL: options: get called when deeplink get deferred.
Furthermore, the issue related to getting /google/link/?dismiss=1&is_weak_match=1 more likely is a native Firebase library issue

Hey all, looks like there was a firebase sdk release yesterday re https://github.com/firebase/firebase-ios-sdk/issues/233 - which in theory should fix this:
image

Can someone try updating their Links pod to the version mentioned there and see how they get on?

Turns out the pod hasn't been published yet, hopefully there end of the day... 馃

Firebase iOS Release is delayed, expected release date Thursday January 18, 2018.
Please try new release and let me know did it fixed this issue.

No worries @OleksiyA , thanks for the update.

Is anybody able to confirm whether the latest pod release fixed this issue?

I'm going to close this off, assuming as fixed by the latest firebase iOS SDK release. Please re-open if this isn't the case.

Not sure if this is related or not, but it could be. Have a problem with dynamic link on iOS when the app is not yet installed on the device. Link takes me to the store, then to debug it I install it with XCode, I see the dynamic link is received in the native side in my appdelegate, but when RN side calls for getInitialLink, null is received.

When debugging this library on iOS side, I can see that userActivityDictionary (in getInitialLink method) is empty, which results to no initial link path. When app is already installed, userActivityDictionary has three objects, which makes returning the dynamic link url succeed.

@eduplus also seeing this issue - did you find any resolution?

No, I don't think so - I ended up changing projects and don't really know what happened with that.

I have the same issue with react-native-firebase 5.0.0
When install app from Google Play it works fine, but if I install it from App Store, my getInitialLink() method returns undefined instead of url.
It would be great to know that there is a solution for this issue.
Maybe I should use some older version of this library. And if yes - then which exactly.

The problem persist on, someone know how resolve this problem?

react-native: 0.57.0,
react: 16.5.0,
react-native-firebase": ^5.0.0,

Is it working now on iOS after an install ? Or do we need to use Branch.io for that use case ? Thanks

+1 on this issue. Seem to be having a hard time getting initial link to persist after App Store download.

Any updates?

Was this page helpful?
0 / 5 - 0 ratings