如果我的应用不在应用商店中,如何测试Firebase动态链接?
我希望能够打开应用程序,并在单击动态链接时打印参数(即使尚未发布)如果我的应用不在应用商店中,如何测试Firebase动态链接?,firebase,app-store,firebase-dynamic-links,Firebase,App Store,Firebase Dynamic Links,我希望能够打开应用程序,并在单击动态链接时打印参数(即使尚未发布) 有办法做到这一点吗?是的!事实上,我在入门视频中详细介绍了这个过程,如果您还没有开始,我建议您查看一下 但是,一般来说,你只需点击一个动态链接,就可以测试“如果我安装了我的应用程序,就打开它”的流程。如果你的应用程序安装在设备上,它应该可以正常打开;即使它不是一个已发布的应用程序 如果您想测试未安装的流,这也很容易 首先,在项目设置中为Firebase项目提供应用商店ID。它可以是任何有效的应用程序商店ID——它不一定是针对您
有办法做到这一点吗?是的!事实上,我在入门视频中详细介绍了这个过程,如果您还没有开始,我建议您查看一下 但是,一般来说,你只需点击一个动态链接,就可以测试“如果我安装了我的应用程序,就打开它”的流程。如果你的应用程序安装在设备上,它应该可以正常打开;即使它不是一个已发布的应用程序 如果您想测试未安装的流,这也很容易
- 首先,在项目设置中为Firebase项目提供应用商店ID。它可以是任何有效的应用程序商店ID——它不一定是针对您的应用程序的
- 然后生成一个新的动态链接
- 这一次,当你点击这个新链接时,它会将你带到上面列出的ID的应用商店。您不需要实际安装此应用程序,只需将其添加到应用程序商店列表即可
- 现在,继续安装并运行你的应用程序。如果一切正常,它应该为您检索并显示动态链接数据
[bundle_id]://google/link/?deep_link_id=[firebase_universal_link]
在确定了这一点之后,我在Firesabe SDK中找到了DynamicClinkFromCustomSchemeUrl
方法,我可以通过动态链接在第一次应用程序发布时解决我的问题
/**
* @method dynamicLinkFromCustomSchemeURL:
* @abstract Get a Dynamic Link from a custom scheme URL. This method parses URLs with a custom
* scheme, for instance, "comgoogleapp://google/link?deep_link_id=abc123". It is suggested to
* call it inside your |UIApplicationDelegate|'s
* |application:openURL:sourceApplication:annotation| and |application:openURL:options:|
* methods.
* @param url Custom scheme URL.
* @return Dynamic Link object if the URL is valid and has link parameter, otherwise nil.
*/
- (nullable FIRDynamicLink *)dynamicLinkFromCustomSchemeURL:(NSURL *)url
NS_SWIFT_NAME(dynamicLink(fromCustomSchemeURL:));
/**
* @method dynamicLinkFromUniversalLinkURL:completion:
* @abstract Get a Dynamic Link from a universal link URL. This method parses the universal link
* URLs, for instance,
* "https://example.page.link?link=https://www.google.com&ibi=com.google.app&ius=comgoogleapp".
* It is suggested to call it inside your |UIApplicationDelegate|'s
* |application:continueUserActivity:restorationHandler:| method.
* @param URL Custom scheme URL.
* @param completion A block that handles the outcome of attempting to get a Dynamic Link from a
* universal link URL.
*/
- (void)dynamicLinkFromUniversalLinkURL:(NSURL *)url
completion:(FIRDynamicLinkUniversalLinkHandler)completion
NS_SWIFT_NAME(dynamicLink(fromUniversalLink:completion:));
/**
* @method dynamicLinkFromUniversalLinkURL:
* @abstract Get a Dynamic Link from a universal link URL. This method parses universal link
* URLs, for instance,
* "https://example.page.link?link=https://www.google.com&ibi=com.google.app&ius=comgoogleapp".
* It is suggested to call it inside your |UIApplicationDelegate|'s
* |application:continueUserActivity:restorationHandler:| method.
* @param url Custom scheme URL.
* @return Dynamic Link object if the URL is valid and has link parameter, otherwise nil.
*/
你以前见过这个吗?也许可以实现同样的功能,只需要在需要的地方包含一些日志?非常感谢-正如预期的那样。次要补充:为了快速测试,你们甚至不需要应用商店Id——只需点击动态链接,它就会进入游戏商店并显示“未找到物品”。接下来只需安装你的应用程序-它将自动接收来自intent的链接,并表现得像按下了链接一样。这是测试未安装流的好方法。我发现当安装应用程序时,会调用方法
application:UIApplication,continue userActivity:nsseractivity,restorationHandler
,但当未安装应用程序时,会调用方法app:UIApplication,open url:url,options
@托德·克佩尔曼:对吗?完美答案@汤姆·斯佩的评论在这方面也有所帮助+1@Todd,当我们点击动态链接时场景1:当安装应用程序时::我们正确获取URL。场景2:当应用程序没有内置时,我们得到的URL为NULL。在这种情况下,如何做到这一点?代码参考截图嗨,我面临同样的问题。。。你能详细介绍一下DynamicClinkFromCustomSchemeUrl或给我发代码吗