繁体   English   中英

使用 Ionic 5 和电容器设置 BranchIo

[英]Set up BranchIo with Ionic 5 and Capacitor

我正在从 Ionic 3 迁移到 Ionic 5 和 Cordova 到电容器。 我在使用在 Ionic 3 中完美运行的 BranchIo 插件时遇到了问题。我已经按照本文档安装了 Capacitor 插件,其中包含以下内容。

npm install branch-cordova-sdk
npm install @ionic-native/branch-io
ionic cap sync

安装没有错误。 现在我不能按照 Cordova 的文档,因为我正在使用电容器。 因此,我正在尝试按照 Android 基本集成的分支文档在 Adroid Studio 中设置我的本机应用程序。

我能够在AndroidManifest.xml文件中添加的唯一代码没有错误。

<!-- Branch init -->
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_xxxxxxxx" />
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_xxxxxxxx" />
<meta-data android:name="io.branch.sdk.TestMode" android:value="true" />



<!-- Branch App Links (optional) -->
<intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="xxxx.app.link" />
        <data android:scheme="https" android:host="xxxx-alternate.app.link" />
</intent-filter>

除此之外,我添加的任何建议代码都会出错。 就像在AndroidManifest.xml<application>中添加以下行

android:name="com.eneff.branch.example.android.CustomApplicationClass"

谁能提供使用 Ionic 5 和电容器设置 BranchIo 的指导?

注意:我也尝试使用电容器社区插件电容器分支深度链接,但这个插件只有监听链接的方法,没有创建链接的方法。

更新:

我能够获取由 Branch 方法createBranchUniversalObject创建的链接,但该链接未格式化。 我得到以下完整链接。

https://bnc.lt/a/key_test_xxxxxx?feature=share&type=0&duration=0&source=android&data=xxxxxx

此链接也打开了正确的页面。 唯一不起作用的部分是链接不是短分支链接的转换器。

一个分店在这里 -

目前我们有一张内部票可以为 Capacitor 提供支持,但还没有截止日期。 对于 Cordova SDK,您可以参考我们的文档 - https://help.branch.io/developers-hub/docs/cordova-phonegap-ionic

对于 Capacitor,我们确实有功能请求,但没有设置时间线。 您也可以通过 Github 问题 go 供参考 - https://github.com/BranchMetrics/cordova-ionic-phonegap-issue-branch/

虽然还有一个社区插件可供您参考,但它不是官方的,可能会导致未知问题。

我会用未来的 SDK 开发来更新这篇文章。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM