9

I looked at the Firebase iOS SDK code on Github for a few minutes, but I wasn't able to full put together how Firebase Dynamic Links survive app installation. It seems it uses some type of fingerprinting. I wasn't sure if it did that using:

  • iOS Pasteboard - but how does Safari write to that when user clicks on link before install?
  • cookie - so does the SDK read the cookie after install, or maybe make XmlHttpRequest in UIWebview to Firebase service?
  • IP address and user agent of request to Firebase service?
  • something else????
Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
jacob
  • 2,762
  • 1
  • 20
  • 49
  • 2
    I don't know about iOS, but on Android, when you follow a link to the Play store entry for an app, that link can effectively arrange for the store to deliver a small piece of data to the app that you check on launch. https://developers.google.com/analytics/devguides/collection/android/v2/campaigns#google-play-how – Doug Stevenson Jan 31 '19 at 22:27
  • @doug-stevenson Thanks! I was interested also in how Android does it, but I can't find the source code for Android implementation. It doesn't seem to be in Android Firebase SDK. Is it on Github? – jacob Jan 31 '19 at 22:31
  • 1
    It's not open source currently. – Doug Stevenson Jan 31 '19 at 22:32

1 Answers1

6

The answer seems to be in a comment in the iOS SDK FIRDLDefaultRetrievalProcessV2.m file:

// Reason for this string to ensure that only FDL links, copied to clipboard by AppPreview Page
// JavaScript code, are recognized and used in copy-unique-match process. If user copied FDL to
// clipboard by himself, that link must not be used in copy-unique-match process.
// This constant must be kept in sync with constant in the server version at
// durabledeeplink/click/ios/click_page.js

Then the SDK reads the clipboard using UIPasteboard.

jacob
  • 2,762
  • 1
  • 20
  • 49
  • Do we know how this works on iOS now that apps have to explicitly be approved by the user when accessing the clipboard? ie: Does an app that use Firebase Dynamic Links bring up the dialogue prompting the user to allow pasting from the clipboard? – micnguyen Aug 22 '22 at 05:36
  • See this GitHub issue for more discussion about this change in iOS 16, and potential workarounds: https://github.com/firebase/firebase-ios-sdk/issues/9892 – jacob Aug 22 '22 at 12:08