In the documentation it says to add the following lines to my AppDelegate.swift
:
// Set deepLinkURLScheme to the custom URL scheme you defined in your
// Xcode project.
FIROptions.default().deepLinkURLScheme = self.customURLScheme
From what I understand this should be the same link you put in your info.plist
. However, I'm confused why in the quickstart-ios repo they decided to make this equal to "dlscheme".
Can anybody help me understand what exactly this scheme is?
Dynamic Links are smart URLs that allow you to send existing and potential users to any location within your iOS or Android app. They survive the app install process, so even new users see the content they're looking for when they open the app for the first time. Dynamic Links are no-cost forever, for any scale.
To help you debug your Dynamic Links, you can preview your Dynamic Links' behavior on different platforms and configurations with an automatically-generated flowchart. Generate the flowchart by adding the d=1 parameter to any short or long Dynamic Link. For example, example. page.
The created short Dynamic Link will not expire. Repeated calls with the same long Dynamic Link or Dynamic Link information will produce the same short Dynamic Link. The Dynamic Link domain in the request must be owned by requester's Firebase project.
You create a Dynamic Link either by using the Firebase console, using a REST API, iOS or Android Builder API, or by forming a URL by adding Dynamic Link parameters to a domain specific to your app. These parameters specify the links you want to open, depending on the user's platform and whether your app is installed.
This is not clear in the Dynamic Links integration instructions — I ran into the same issue even though I work with these things all day at Branch.io (full disclosure: we're an alternative/improvement to Dynamic Links).
When configuring a custom URI scheme, you need to supply both an Identifier and a URL Scheme. Apple recommends using a reverse domain value for the Identifier, but since your bundle ID is also typically reverse domain format, these two often end up being identical.
By default, Firebase expects you to use your bundle identifier as your custom URI scheme. When you do this, their default configuration takes over and you don't need to specify the FIROptions.default().deepLinkURLScheme = self.customURLScheme
line at all. The URI scheme config ends up looking like this, which is a bit counter-intuitive:
However, if you decide to use a value that is not your bundle ID for the URL Scheme (very common), then you DO need the FIROptions.default().deepLinkURLScheme = self.customURLScheme
line. But you also need this one before it: let customURLScheme = "somethingelse"
. You can see this here in the quickstart, and also where the URI scheme is defined in the info.plist
file here.
Basically, the Firebase team tried to simplify things by assuming the bundle ID as the custom URI scheme value. This is not a bad option, but it can be confusing and as you can see, even their own quickstart project uses a more advanced config.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With