7

I am currently busy using the firebase dynamic link and everything works well except one thing.

When I click on a firebase link, I will be redirected to the appstore where I can download the app. When I download the app, the openURL method is called and the dynamic link is not empty, just as it should be.

Now if I delete the app and reinstall it again, the dynamic link is still NOT empty. Why is that?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
IOSporgrammerIOS
  • 223
  • 4
  • 12

2 Answers2

11

Firebase Dynamic Link will not be "consumed" after link was received by your App. Dynamic Link will have 1 hour lifetime since you clicked on link in Safari. To inform App that link was previously used, we provide parameter DynamicLink.matchType.

When your App first receiving the Dynamic Link the matchType will be default. (Exception here if copy unique match succeeded, then matchType will be unique.) All subsequent links will have matchType weak. Also if matchType have value none, this means match was not achieved.

Please provide example of the link you receiving for the first and subsequent time to be sure I interpreting you situation correct.

Ashok
  • 5,585
  • 5
  • 52
  • 80
Oleksiy Ivanov
  • 2,454
  • 15
  • 21
  • 1
    I am getting this and I am able to click the link fine when the app is open and it gets the correct https:// url and I am able to deep link. When it hits the AppDelegate lifecycle method 'open url' the url seems to be null. } The url seems to be mySchemeString://google/link/dismiss=1&is_weak_match=1 – mevdev Jan 23 '18 at 01:24
  • For the 'open url' method I am using: if let dynamicLink = DynamicLinks.dynamicLinks()?.dynamicLink(fromCustomSchemeURL: url) And the one that works the restorationHandler I am using let handled = dynamicLinks.handleUniversalLink(userActivity.webpageURL!) help! – mevdev Jan 23 '18 at 01:26
  • @Oleksiy Ivanov. What is the concept of matchType? I have read the doc: https://firebase.google.com/docs/reference/swift/firebasedynamiclinks/api/reference/Enums/DLMatchType, But I didn't get it. And how dynamic link validity is relevant to match type? – Ashok Mar 09 '18 at 06:35
  • FYI, When I add DynamicLinks Framework via cocoapods, DynamicLink.matchType is not available but when I download the library files manually from here: https://firebase.google.com/download/ios, I can see DynamicLink.matchType. – Ashok Mar 09 '18 at 10:18
  • @mevdev Please update to latest release of the Firebase Dynamic Links SDK, the output you provided generated by older SDK. – Oleksiy Ivanov Mar 09 '18 at 22:15
  • @AshokKumarS match for deferred deep linking means connecting two events. First event is "tap on link in Safari" (or other browser). Second event is "app launched". Depending on type of the match, confidence of the received link will be different. About missing DynamicLink.matchType: please examine header file when using CocoaPods and check is matchType present there. – Oleksiy Ivanov Mar 09 '18 at 22:22
  • 1
    @OleksiyIvanov. Not able to depend on matchType to solve the problem, because getting 'matchType' as 'Unique' always. 1. When the App is not installed on the device: Tap on Dynamic link -> App store -> Install the app -> Open the app -> Match Type is Unique. 2. Uninstall and install the app from App Store again -> Open the app -> Match Type is Unique. 3. When the App is installed on the device: Tap on Dynamic link -> It will open the app -> Match Type is Unique. – Ashok Mar 12 '18 at 06:57
  • @AshokKumarS In case 2. you should have received weak match type. Can you note content of the clipboard on the iOS device before and after steps 1. and 2. ? After step 1. the content of the clipboard must be cleared by FDL iOS SDK, so in 2. you should be receiving "weak" match type. Alternatively, open Firebase support bug and provide this information in the bug. – Oleksiy Ivanov Mar 12 '18 at 21:39
  • I'm using react-native with firebase deep link but there is no DynamicLink.matchType is there any solution for this? – Ugur May 27 '22 at 06:24
-1

add your link to Info.plist like this:

for example, your are using target link is: https://server-ozm3wg7wda-uc.a.run.app/ and your firebase dynamic link is: https://myapptest.com/link/?link=${encodedLink}&apn=${bundleId}&isi=1449448875&ibi=${bundleId}

// Info.plist
<dict>
 //....
<key>FirebaseDynamicLinksCustomDomains</key>
<array>
    <string>https://myapptest.firebaseapp.com</string>
    <string>https://myapptest.com/link</string>
</array>
//...
</dict>

p/s: origin instruction is here: https://firebase.google.com/docs/dynamic-links/custom-domains

Hiep Tran
  • 3,735
  • 1
  • 21
  • 29