我正在使用Firebase动态链接来共享我的应用程序(> =
IOS 9),并邀请他人参加活动(我的意思是,如果你有这个应用程序可以加入DeepLink的活动,如果没有,在加入该活动之前,我们将发送给应用商下载应用程序).
我遵循Firebase文档步骤:
>我在https://app_code.app.goo.gl/apple-app-site-association获得相关的JSON.
>如果我的应用程序已安装,则DeepLink正在运行良好.
>如果我的应用没有安装,则Deeplink会将您发送给应用商店,但是首次打开时,它不起作用,您无法加入该活动.
在didFinishLaunchingWithOption:
FIROptions.default().deepLinkURLScheme = "com.jerem.ProjectAlphaSasasa" // "com.jerem.ProjectAlphaSasasa" is my app bundle Identifier FIRApp.configure()
并基于Firebase文档,首次打开时,我使用以下功能:
//MARK: First entry //when your app is opened for the first time after installation on any version of iOS. func application(_ app: UIApplication,open url: URL,options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool { print("00000000000000000") FIRCrashMessage("Link during first installation") downloadEventWithDeepLink = true downloadUrl = url return application(app,open: url,sourceApplication: nil,annotation: [:]) } //same as prevIoUs but for older version ios 8 (not relevant) func application(_ application: UIApplication,sourceApplication: String?,annotation: Any) -> Bool { let dynamicLink = FIRDynamicLinks.dynamicLinks()?.dynamicLink(fromCustomSchemeURL: url) if let dynamicLink = dynamicLink { downloadEventWithDeepLink = true downloadUrl = dynamicLink.url return true } return false }
在我的情况下,downloadEventWithDeepLink是一个标志(全局),我检查用户登录到我的应用程序(并在那里使用downloadUrl变量).我在设置中做错了什么?
另外,我不知道如何调试它.有没有办法模拟Appstore在Xcode中首次安装?找出以前的功能(Open Url)是否被调用?
谢谢你的帮助!