1

TL;DR; Deep linking with the app installed works, however deferred deep linking doesn't worked.

I m trying to implement the Huawei solution for App Linking.

The version of the App Linking that I use is:

pod 'AGConnectAppLinking', '~> 1.6.1.300'

Currently if the user tap the Huawei short link with the app installed the app opens and redirect the user successfully inside the app based on the deep link.

Unfortunately the deferred deep linking scenario doesn't work.

  1. I open the Huawei link and I click the download button.
  2. When the app opens for the first time I'm showing the popup for pasting content.
  3. The content in the clipboard is something like that agc_click_id=47XXXXXXXXX.
  4. But nothing happens.

In AppDelegate.m, I already implement the following code which is work like a charm when the user has already the app and taps the deep linking.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [AlphaGlobals.sharedGlobals application:application didFinishLaunchingWithOptions:launchOptions];
    
    [AGCInstance startUp];
    
    [[AGCAppLinking sharedInstance] handleAppLinking:^(AGCResolvedLink * _Nullable link, NSError * _Nullable error) {
        if (link) {
            NSString *deepLink = link.deepLink;
            NSLog(@"Deeplink = %@", deepLink);
        }
    }];
    
    return YES;
}
-(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
   BOOL isAppLinking = [[AGCAppLinking sharedInstance] continueUserActivity:userActivity];
   return isAppLinking

}

Am I missing something for Deferred deep linking?

yannisalexiou
  • 605
  • 12
  • 25

1 Answers1

0
//MARK:AGCAppLinking
        AGCAppLinking.instance().handle { (link, error) in
            
            if self.linkTempVC != nil {
                let deepLink = link?.deepLink
                if let r = deepLink!.range(of: "PhotoPlaza://ios/", options: .backwards) {
                    let photoID = String(deepLink![r.upperBound...])
                    linkPhotoID = photoID
                    let vc = DetailViewController()
                    self.linkTempVC!.navigationController?.viewControllers.last?.navigationController?.pushViewController(vc, animated: true)
                }
            }
        }

You are referring to the deferred deep link, which needs to be implemented by using your own code: after the deep link is obtained from didFinishLaunchingWithOptions, and you can customize a page based on the deep link information.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • What do you mean "to be implemented by using your own code". Can you provide a working example or steps to handle the deferred deep link through App Linking? – yannisalexiou Apr 21 '22 at 08:26
  • Do you implement deep link and can you redirect to a specific page? i just updated my answer, kindly refer that. – zhangxaochen Apr 21 '22 at 08:57
  • During the deferred deep link process the `[[AGCAppLinking sharedInstance] handleAppLinking` method doesn't return in callback. – yannisalexiou Apr 21 '22 at 09:02
  • Is this problem found during conversion test or after the app is released? also please check whether the network request conditions are met when the code is invoked. – zhangxaochen Apr 22 '22 at 02:43