4

我试图在示例 iOS 应用程序上集成 FireBase 深层链接,深层链接正在启动我的应用程序,尝试解析深层链接时得到空响应,动态链接对象为 nil,错误为 nil。

这是我的代码

   - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler
  {

    if (userActivity.webpageURL) {

        NSLog(@"url exists");

        NSLog(@"web page url is %@", userActivity.webpageURL);

        BOOL handled = [[FIRDynamicLinks dynamicLinks]
                          handleUniversalLink:userActivity.webpageURL
                          completion:^(FIRDynamicLink * _Nullable dynamicLink,
                                       NSError * _Nullable error) {
                              if (error) {
                                  NSLog(@"error in link object is %@", error);

                              }
                              else{
                                  NSLog(@"dynamic link object is %@", dynamicLink);
                              }
                          }];

        return handled;
    }
    return NO;
  }
4

0 回答 0