Firebase dynamic deep link arrives nil after install

人走茶凉 提交于 2019-12-10 06:21:29

问题


I am attempting to use Firebase to pass deep links into my app that survive install.

To test this I am following the steps provided by the Firebase documentation and Firecast video here at about the 12min 40s mark. The steps are as follows:

  1. First I delete the app from my device.
  2. Then I press the link to open the app store.
  3. Then I run my app from xcode.
  4. Expected: The dynamicLink.url property will be equal to "https: //www.example.com/data/helloworld" in application:openURL
  5. Reality: The dynamicLink.url property arrives nil.

This is the deeplink url that I created in the Firebase console: https://nqze6app.goo.gl/RIl8

This is the url that is passed into application:openURL prior to being passed into dynamicLinkFromCustomSchemeURL : com.johnbogil.voices://google/link/dismiss?fdl_cookie

This is the code in my openURL call:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options { 
  FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
  if (dynamicLink) { 
    NSLog(@"I am handling a link through the openURL method"); 
    [self handleDynamicLink:dynamicLink]; 
    return YES; 
  } else { 
    return NO; 
  } 
}

Not sure why dynamicLink.url is arriving nil. Any assistance is appreciated.


回答1:


For anybody who else who's encountering this same error...

  1. If your application:openURL method is getting called, and
  2. You do seem to be getting a valid dynamicLink object from your dynamicLinkFromCustomSchemeURL method, but
  3. The url parameter of that dynamicLink object is nil

Then double-check to see if you're in "Private" mode in Safari. That will kinda mess with Firebase Dynamic Links' ability to retrieve the original link that you clicked on.




回答2:


I had the same issue. I was getting callback of restorationHandler but in handleUniversalLink callback dynamiclink and error both were nil. After spending some time I found my issue.

Turns out, url is case sensitive. For example if your url is:

https://xzz6b.app.goo.gl/0EWv

and you wrote https://xzz6b.app.goo.gl/0ewv in notes and clicked it. It will load your app and even give you callback of restorationHandler but dynamiclink will be nil.

You can try it even in browser.

Hope it helps anybody.



来源:https://stackoverflow.com/questions/39107766/firebase-dynamic-deep-link-arrives-nil-after-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!