Firebase dynamic linking - Continueuseractivity not returning dynamic link url

前端 未结 3 1105
北海茫月
北海茫月 2021-01-22 09:29

My requirement is to handle universal links on the iOS application. But the dynamic link.url seems to be returning an error as below -

\"@\"error\" : @\"unauth         


        
3条回答
  •  猫巷女王i
    2021-01-22 09:54

    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;
    }
    

提交回复
热议问题