Reputation: 13294
I am using firebase dynamic link. I am facing 2 issues firebase official website doesn't have enough information and already did googling.
(1) When i created link programatically it doesn't work on safari. but if i copy link and open it in chrome or other browser its working like charm.(also doesn't working on facebook app)
(2) I got dynamic link and its working in chrome browser without giving any kind of error. but at firebase console there are no listing for that all links except if i created dynamic link by using console then it will appear in console.(programmatically doesn't reflect on console)
Here is my code for create dynamic link:
let strLink = "https://google.com/page?Id="+self.textField1.text!
guard let deepLink = URL(string: strLink) else { return }
let components = DynamicLinkComponents(link: deepLink, domain: "e59pd.app.goo.gl")
let iOSParams = DynamicLinkIOSParameters(bundleID: "com.procorner.eduflex")
iOSParams.minimumAppVersion = "8.0"
components.iOSParameters = iOSParams
let socialParams = DynamicLinkSocialMetaTagParameters()
socialParams.title = "Title is here..."
socialParams.descriptionText = "Description is here"
socialParams.imageURL = URL(string:"https://firebasestorage.googleapis.com/v0/b/todo-list-1da4a.appspot.com/o/shopping%403x.png?alt=media&token=b5f02235-5c1e-4354-94c5-1354eb36bed9")
components.socialMetaTagParameters = socialParams
// Build the dynamic link
let link = components.url
print("\n\n\n\nlink",link)
// Or create a shortened dynamic link
components.shorten { (shortURL, warnings, error) in
if let error = error {
print(error.localizedDescription)
return
}
print("\n\n\nshortURL",shortURL)
self.strGLink = (shortURL?.path)!
self.textVIew1.text = shortURL?.absoluteString
// TODO: Handle shortURL.
}
Upvotes: 5
Views: 4446
Reputation: 2514
(1) Please clarify how do you test links in Safari? What other browsers besides Chrome works correctly? Also how you test in Facebook iOS App?
If you paste link to browser address bar and hit returns, this will not work. Reason that Firebase Dynamic Links are using Universal Links. Universal Links will not engage when link is pasted to Safari. Firebase Dynamic Links will still handle this case correctly because of AppPreview page. If you pasted link to Safari, you should see AppPreview page. Tapping on OPEN
button here should engage Universal Links and open your App.
Chrome deviates from a way how iOS (and Safari) handles Universal Links. Some people would say deviates to the better.
(2) Firebase Dynamic Links created using API will not show up in console.
Reasoning for this: some of our clients like Google Photos creating north of couple millions Firebase Dynamic Links per day. Trying to show this amount of information in console does not looks like good idea. Trying to consume this information in console probably will be not fun.
At the same time, if you have use case that requires you to see all your links in Firebase console, feel free to open Firebase ticket or post details here. We always open for ideas for new features or improvements.
Upvotes: 3
Reputation: 2828
Short answer: Chrome uses URI schemes, Safari defaults to Universal links. This means you can type the firebase link into Chrome and it will open the app via a URI scheme, but in safari you must click on the firebase link to open the app because safari uses universal links.
Firebase dynamic links rely on the use of URI schemes OR Universal links to open the app. Safari defaults to using Universal links, whereas Chrome will use the URI scheme if the app is installed. This is important because Universal links will only open an app if they are clicked on, not if they are typed into the address bar or opened programatically. To open the app from Safari, you will need to paste it somewhere that will register it as a link and then click on it.
I suggest using messages or notes to open your firebase links, as this will allow you to click on the firebase links to enable the universal link.
Upvotes: 5