React Native Branch.io延迟链接仅在第二次启动时处理

gojuced7  于 6个月前  发布在  React
关注(0)|答案(1)|浏览(65)

我们在iOS上的ReactNative应用中遇到了Branch.io链接的问题。当我们的应用使用Branch.io的延迟链接安装时,我们在打开应用时不会收到链接数据。但是,在用户重新启动应用后,链接会得到处理。

更新

根据要求,我们正在附加(混淆)logs时,应用程序通过链接安装和logs时,应用程序安装(和最小化)时,链接被打开.我还附上我们的AppDelegate file
以下是我们的RN代码:

import branch, { BranchSubscriptionEvent } from 'react-native-branch';

useEffect(() => {
        const unsubscribe = branch.subscribe((value: BranchSubscriptionEvent) => {
          console.log('value', value);
          //more handling of the link
        };
    
        return unsubscribe;
      }, [...dependencyList]);

字符串
对象,这是登录到控制台时安装在iOS上通过链接是:

{
    "error": null,
    "params": {
        "+non_branch_link": "com.ourapp.app://google/link/?request_ip_version=IP%5FV4&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E",
        "+is_first_session": true,
        "+clicked_branch_link": false,
        "+rn_cached_initial_event": true
    },
    "uri": "com.ourapp.app://google/link/?request_ip_version=IP%5FV4&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E"
}


当我们重新启动应用程序时,正确的链接得到处理:

{
    "error": null,
    "params": {
        "~channel": "App",
        "+is_first_session": false,
        //more fields...
        "~feature": "Signup",
        "~campaign": "Refferal",
        "deeplinkURL": "our custom data to handle link",
        "~tags": [
            "referral"
        ]
    },
    "uri": null
}


该链接是通过Branch.io API创建的

{
    "data": {
        "$desktop_url": "https://ourdomain.com",
        "deeplinkURL": "our custom data to handle link"
    },
    "channel": "App",
    "campaign": "Referral",
    "feature": "Signup",
    "tags": [
        "referral"
    ],
    "branch_key": "{{branchKey}}"
}


任何想法为什么我们没有得到所有的数据与第一次启动的应用程序?Android的工作正常。

kpbpu008

kpbpu0081#

我可以看到**"+clicked_分支_link”:false,当键不匹配或者你使用了错误的快速链接(实时或测试)时,这可能会发生。
请使用此
[RNBranch enableLogging];启用日志记录并共享。要启用测试示例,请使用此RNBranch.useTestInstance()**
请将分支SDK置于应用程序委托文件的顶部,并在初始化之前使用测试密钥进行测试。
您是否还可以验证您的应用程序委派文件是否与此https://help.branch.io/developers-hub/docs/react-native#ios-1类似

相关问题