Reputation: 113
I followed the dynamic link for ios video and tutorials. After everything is setup, when I click on the dynamic link https://a75xd.app.goo.gl/2rkG , I get null in the completion method of the handleUniversalLink:userActivity.webpageURL.
But when I use the full URL as found in link details in firebase console, I get the link parameters perfectly.
Upvotes: 3
Views: 2146
Reputation: 149
i faced this issue and resolve it by the following steps
1- delete the app
2- open the dynamic link from massages or email or note
3- the dynamic link should be go to the app store
4- go to Xcode and rebuild the app
5- reopen the dynamic link and the dynamicLinks.url will return value
Upvotes: 3
Reputation: 1847
Try this one.
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler
{
NSURL *url = userActivity.webpageURL;
FIRDynamicLinks *links = [FIRDynamicLinks dynamicLinks];
if([links matchesShortLinkFormat:url])
{
[links resolveShortLink:url completion:^(NSURL * _Nullable url, NSError * _Nullable error)
{
NSString *message =
[NSString stringWithFormat:@"Deep link \n:%@",
url];
[[[UIAlertView alloc] initWithTitle:@"Deep-link Data"
message:message
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] show];
}];
return YES;
}
return false;
}
Upvotes: -1