有没有办法认识到,该应用程序通过didFinishLaunchingWithOptions中的firebase动态链接安装? [英] Is there a way to recognize, that the app was installed thru firebase dynamic link in didFinishLaunchingWithOptions?

查看:295
本文介绍了有没有办法认识到,该应用程序通过didFinishLaunchingWithOptions中的firebase动态链接安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的iOS应用程序中实现Firebase动态链接,我已经可以解析链接,重定向到AppStore等。现在我想区分应用程序的第一次运行,当用户从动态链接安装它 - 我想跳过介绍并向他展示预计将显示的内容。

是否有一些参数,我可以在 application(_:didFinishLaunchingWithOptions:)它是通过动态链接发起的?
$ b 方法 application(_:continueUserActivity:userActivity:restorationHandler:)稍后调用,所以介绍已经推出。

这种情况很难测试,因为你必须在AppStore上发布你的应用程序。

解决方案

实际上,您不需要在App Store中发布应用程序就可以工作 - 点击链接,关闭应用程序商店,然后通过Xcode(或任何其他测试版分发平台,如TestFlight或Fabric)安装应用程序生成具有完全相同的效果。



根据 Firebase文档,方法是要求第一次安装是 openURL (不,这对我来说也没有意义)。 continueUserActivity 方法适用于Universal Links,只有当应用程序已经安装时,链接才能打开。



我不知道有什么方法可以检测应用何时从延迟链接安装后第一次打开,但您可以直接路由到共享内容(跳过介绍)只要有深层链接存在。如果深层链接不存在,则显示正常介绍。






其他选项



您可以查看 Branch.io (完全披露:我在分支团队中)。除此之外,Branch是Firebase动态链接的一个很好的免费下载替代品,它具有许多其他功能。下面是所有参数的例子:分支立即返回 didFinishLaunchingWithOptions

  {
branch_view_enabled= 0;
browser_fingerprint_id=< null>;
data ={
\+ is_first_session \:false,
\+ clicked_branch_link\:true,
\match_guaranteed\ :true,
\$ canonical_identifier \:\room / OrangeOak \,
\$ exp_date \:0,
\$ identity_id \:\308073965526600507 \,
\$ og_title \:\Orange Oak \,
\$ one_time_use \:false,
\$ public_indexable\:1,
\room_name\:\Orange Oak \,//这是一个自定义参数,其中您可以有无限的数字
\〜channel \:\pasteboard \,
\〜creation_source\:3,
\〜feature\: \sharing \,
\〜id \:\319180030632948530\,
\+ click_timestamp \:1477336707,
\ 〜referring_link\:\https://branchmaps.app.link/q TLPNAJ0Jx \
};
device_fingerprint_id= 308073965409112574;
identity_id= 308073965526600507;
link =https://branchmaps.app.link/?%24identity_id=308073965526600507;
session_id= 319180164046538734;





$ b

您可以在Branch文档中详细了解这些参数 here


I am implementing firebase dynamic links in my iOS app and I can already parse the link, redirect to AppStore etc. Now I want to distinguish the first run of the app, when user installs it from the dynamic link - I want to skip the intro and show him the content that is expected to be shown.

Is there some parameter, that I could catch in application(_:didFinishLaunchingWithOptions:) so I could say that it was launched thru the dynamic link?

The method application(_:continueUserActivity:userActivity:restorationHandler:) is called later, so the intro is already launched.

This case is difficult to test, because you have to have your app published on the AppStore.

解决方案

You actually don't need to have the app published in the App Store for this to work — clicking a link, closing the App Store, and then installing an app build through Xcode (or any other beta distribution platform like TestFlight or Fabric) has exactly the same effect.

According to the Firebase docs, the method that is called for the first install is openURL (no, this makes no sense to me either). The continueUserActivity method is for Universal Links, and is only used if the app is already installed when a link is opened.

I am not aware of any way to detect when the app is opening for the first time after install from a 'deferred' link, but you could simply route directly to the shared content (skipping the intro) whenever a deep link is present. If a deep link is NOT present, show the regular intro.


Alternative Option

You could check out Branch.io (full disclosure: I'm on the Branch team). Amongst other things, Branch is a great, free drop-in replacement for Firebase Dynamic Links with a ton of additional functionality. Here is an example of all the parameters Branch returns immediately in didFinishLaunchingWithOptions:

{  
    "branch_view_enabled"   = 0; 
    "browser_fingerprint_id" = "<null>"; 
    data = "{  
      \"+is_first_session\":false,
      \"+clicked_branch_link\":true,
      \"+match_guaranteed\":true,
      \"$canonical_identifier\":\"room/OrangeOak\",
      \"$exp_date\":0,
      \"$identity_id\":\"308073965526600507\",
      \"$og_title\":\"Orange Oak\",
      \"$one_time_use\":false,
      \"$publicly_indexable\":1,
      \"room_name\":\"Orange Oak\", // this is a custom param, of which you may have an unlimited number
      \"~channel\":\"pasteboard\",
      \"~creation_source\":3,
      \"~feature\":\"sharing\",
      \"~id\":\"319180030632948530\",
      \"+click_timestamp\":1477336707,
      \"~referring_link\":\"https://branchmaps.app.link/qTLPNAJ0Jx\"
    }"; 
    "device_fingerprint_id" = 308073965409112574; 
    "identity_id" = 308073965526600507; 
    link = "https://branchmaps.app.link/?%24identity_id=308073965526600507"; 
    "session_id" = 319180164046538734;
}

You can read more about these parameters on the Branch documentation here.

这篇关于有没有办法认识到,该应用程序通过didFinishLaunchingWithOptions中的firebase动态链接安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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