iOS-测试让Facebook推迟了深层链接 [英] iOS - Test getting Facebook deferred deep link

查看:80
本文介绍了iOS-测试让Facebook推迟了深层链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过测试应用链接"将其发送到我的应用后,我想获得延迟的深层链接.FB测试工具.

I want to get deferred deep link after sending it to my app via "Test App Link" FB testing tool.

我已经在Xcode项目设置中提供了AppID,并在AppDelegate文件中实现了fetchDeferredAppLick方法.以及在FB开发人员帐户和xcode项目info.plist文件中设置所有必要的应用程序设置.
但这在FB应用程序设置中仍然没有显示绿色复选标记.

I've provided AppID in the Xcode project settings and implemented fetchDeferredAppLick method in the AppDelegate file. As well as I set all necessary app settings in the FB dev account and in xcode project info.plist file.
But it still doesn't show me green checkmarks in the FB app settings.

当我通过单击测试深层链接"向应用程序发送深层链接时,我收到无法为所选平台发送深层链接通知".提示中显示消息.

When I send deep link to the app by clicking "Test Deep Link", I get "Deep link notification could not be sent for the chosen platform" message in the prompt.

那么,关于我已经实现fetchDeferredAppLink方法并提供AppID的事实,如何在应用fb设置中获得绿色的选中标记?

So how can I get green checkmarks in the app fb settings regarding the fact that I've already implemented fetchDeferredAppLink method and provided AppID ?

应用设置:

我的AppDelegate代码:

My AppDelegate code:

class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        AppEvents.activateApp()
        
        ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions) 

        AppLinkUtility.fetchDeferredAppLink { (url, error) in
            
            if let error = error {
                print("Received error while fetching deferred app link: \(error)")
            } else if let url = url {
                
                print("Deeplink is \(url)")
                
                // should open cautch deeplink here
                if #available(iOS 10, *) {
                    UIApplication.shared.open(url, options: [:], completionHandler: nil)
                } else {
                    UIApplication.shared.openURL(url)
                }
            } else { // url is nil 
                print("\nNo app link available\n")
            }
        }
        
        // MARK: - OneSignal
        let onesignalInitSettings = [kOSSettingsKeyAutoPrompt: false]

        // add OneSignal app id
        OneSignal.initWithLaunchOptions(launchOptions, appId: "", handleNotificationAction: nil, settings: onesignalInitSettings)

        OneSignal.inFocusDisplayType = OSNotificationDisplayType.notification;

        // to show the iOS push notification prompt
        OneSignal.promptForPushNotifications(userResponse: { accepted in
          print("User accepted notifications: \(accepted)")
        })
        
        return true
    }
    
    // MARK: - Track App Installs and App Opens
    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        ApplicationDelegate.shared.application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
        return true
    }

    func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
        ApplicationDelegate.shared.application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
        return true
    } 
}

我的信息列表:

PS.我可以在模拟器上登录FB开发者帐户.并且fetchDeferredAppLink方法返回nil.

PS. I'm able to login in the FB dev account on the simulator. And fetchDeferredAppLink method returns nil.

推荐答案

您应在FB App Advanced设置中指定添加帐户ID.

You should specify add account id in the FB App Advanced setting.

如果您有免费的开发者帐户,请从您的Xcode项目中删除推送通知.

If you have free developer account - remove push notifications from your Xcode project.

然后,您应该在物理设备上安装Facebook应用并登录到您注册应用所使用的帐户.

Then on your physical device you should install Facebook app and login into account from which you've registered your app.

插入您的设备.

通过FB测试工具发送延迟的深度链接(选中两个复选框).

Send deferred deeplink via FB testing tool (Mark both checkboxes).

在物理设备上通过Xcode运行您的应用.对于要启动的应用程序,您可以通过手机显示对它的信任->一般->设备管理->开发者应用->信任.

Run your app from Xcode on your physical device. For app to launch you show trust it from your phone Settings -> General -> Device Management -> Developer App -> Trust.

现在,您的应用程序应该可以运行了,您应该获得延迟的深层链接,并且应该在第一张照片的第三个选项附近出现绿色的选中标记.

Now your app should run, you should get deferred deeplink and green checkmark near the third option on the first photo should appear.

这篇关于iOS-测试让Facebook推迟了深层链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆