简体   繁体   English

与IOS中的branch.io进行深度链接时,Cordova Ionic v1 App崩溃

[英]Cordova Ionic v1 App crashes on deep linking with branch.io in IOS

I am using ionic v1 to build a cordova project. 我正在使用ionic v1来构建cordova项目。 My app runs in android and iOS. 我的应用程序可在android和iOS上运行。 But when I try to implement deeplinking using branch, the app is crashing. 但是,当我尝试使用分支实现深度链接时,该应用程序崩溃了。 I am not able to track the console also. 我也无法跟踪控制台。 Here is the details of my app. 这是我的应用程序的详细信息。

Node : 6.11.2 Cordova : 7.1.0 Ionic : 1.7.16 节点:6.11.2科尔多瓦:7.1.0离子:1.7.16

Plugin list 插件清单

branch-cordova-sdk 2.6.24 "branch-cordova-sdk"
com.googlemaps.ios 2.7.0 "Google Maps SDK for iOS"
cordova-custom-config 2.0.3 "cordova-custom-config"
cordova-plugin-admobpro-firebase 2.29.23 "AdMob Plugin Pro"
cordova-plugin-apprate 1.1.7 "AppRate"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-extension 1.5.4 "Cordova Plugin Extension"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-file 4.1.1 "File"
cordova-plugin-file-transfer 1.5.1 "File Transfer"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-googlemaps 1.4.5 "cordova-googlemaps-plugin"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 1.0.1 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
cordova-plugin-x-toast 2.6.2 "Toast"
cordova.plugins.diagnostic 3.1.7 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 1.0.9 "Keyboard"
phonegap-plugin-barcodescanner 6.0.8 "BarcodeScanner"
phonegap-plugin-push 2.1.2 "PushPlugin"

Here is my code : 这是我的代码:

Config.xml config.xml中

<plugin name="branch-cordova-sdk" spec="^2.5.0" />
<branch-config>
<branch-key value="key_live_XXXXXXXX" />
<uri-scheme value="xxxx" />
        <link-domain value="xxxx.app.link" />
        <ios-team-release value="XXXXXXX" />
    </branch-config>

Code : 代码:

// for development and debugging only
Branch.setDebug(true)

// for GDPR compliance (can be called at anytime)
Branch.disableTracking(true);

// Branch initialization
Branch.initSession().then(function(data) {
  if (data['+clicked_branch_link']) {
    // read deep link data on click
    alert('Deep Link Data: ' + JSON.stringify(data))
  }
})

The app is working fine in Android. 该应用程序在Android上运行正常。 But in iOS, it is keep on crashing. 但是在iOS中,它一直崩溃。 Please help 请帮忙

Looks like you are using an older version(v2.6.24) of the Branch Cordova SDK. 看来您使用的是Branch Cordova SDK的旧版本(v2.6.24)。 The latest release is v3.1.0. 最新版本是v3.1.0。 Can you update the SDK to the latest version and check if you are able to reproduce the crash on iOS? 您可以将SDK更新到最新版本,并检查是否能够在iOS上重现崩溃吗?

If you are still able to reproduce the crash, can you please share the symbolicated crash report by writing to support@branch.io? 如果您仍然能够重现崩溃,可以通过发送电子邮件至support@branch.io来共享符号化崩溃报告吗?

I figured out the issue. 我发现了问题。 When I tried to debug using xcode, got the error that branch key not found. 当我尝试使用xcode进行调试时,收到未找到分支键的错误。 When I checked, the info.plist file, branch key was not there. 当我检查时,info.plist文件,分支键不存在。 I tried removing and adding the plugin again, but still branch key was not appending to info.plist file. 我尝试再次删除并添加插件,但是分支键仍未追加到info.plist文件中。 Later I added the following line in my config.xml file, which helped to resolve the issue. 后来我在config.xml文件中添加了以下行,这有助于解决此问题。

<config-file mode="replace" parent="branch_app_domain" platform="ios" target="*-Info.plist">
            <string>myApp.app.link</string>
        </config-file>
<config-file mode="replace" parent="branch_key" platform="ios" target="*-Info.plist">
            <string>key_live_XXXXXXXXXXXXXXXXX</string>
        </config-file>

After adding the above line in config file and build the app once again. 在配置文件中添加以上行后,再次构建应用程序。 Now branch key has been added to info.plist file and app is working properly. 现在,分支键已添加到info.plist文件,并且应用程序正常运行。

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

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