It's working fine when the app is running and in the background. But when the app is installed, but not launched at that time, it's simply opening the app but not redirecting to the respective screen. Please help me to get out of this situation iOS deployment target is iOS9.3.I am running the application on iPhone7 iOS 13.4. Here is my code:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options {
FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
if (dynamicLink != nil) {
[self handleIncomingDynamicLink:dynamicLink];
return YES;
}
return FALSE;
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler {
NSURL *incomingURL = userActivity.webpageURL;
if (incomingURL) {
NSLog(@"Incoming URL is %@:", incomingURL);
BOOL linkHandled = [[FIRDynamicLinks dynamicLinks]handleUniversalLink:incomingURL completion:^(FIRDynamicLink * _Nullable dynamicLink, NSError * _Nullable error) {
if (error != nil) {
NSLog(@"Found an error: \(error?.localizedDescription ?? nil)");
return ;
}
else {
if (dynamicLink) {
[self handleIncomingDynamicLink:dynamicLink];
}
else {
}
}
}];
if (linkHandled) {
return true;
}
else {
// if handling universal link from any other resources. May be do other things from the incoming url
return false;
}
}
return false;
}