You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iOS端Flutter应用冷启动点击Branch.io深度链接崩溃

iOS Flutter应用冷启动时Branch.io深度链接触发崩溃

我给iOS端Flutter应用集成了Branch.io深度链接功能,应用在后台运行时点击链接能正常跳转,但完全关闭的冷启动状态下,点击链接开始跳转后应用立即崩溃。

深度链接相关代码

static Future<void> listen(BuildContext context) async {
    await FlutterBranchSdk.init();
    StreamSubscription<Map>? streamSubscription;

    streamSubscription = FlutterBranchSdk.listSession().listen((data) async {
      if (data.containsKey("groupId") && context.mounted) {
        AppNavigationV2.to(
            AppPages.groupProfileScreen, {"data": data["groupId"]});
      }
    }, onError: (error) {
      PlatformException platformException = error as PlatformException;
      print(
          'InitSession error: ${platformException.code} - ${platformException.message}');
    });
  }

  static Future<void> createLink(String groupId) async {
    BranchUniversalObject branchUniversalObject = BranchUniversalObject(
        canonicalIdentifier: 'flutter/branch',
        contentMetadata: BranchContentMetaData()
          ..addCustomMetadata('groupId', groupId),);
    FlutterBranchSdk.registerView(buo: branchUniversalObject);
    BranchLinkProperties linkProperties =
        BranchLinkProperties(feature: 'sharing');
    linkProperties.addControlParam('\$uri_redirect_mode',
        '1'); // this will redirect the link to application

    BranchResponse response = await FlutterBranchSdk.getShortUrl(
        buo: branchUniversalObject, linkProperties: linkProperties);
    Share.share(response.result);
  }

已排查操作

  • 执行FlutterBranchSdk.validateSDKIntegration();,所有校验项通过
  • Info.plist配置无明显问题

崩溃时Console日志

[(FBSceneManager):sceneID:com.myapp.myapp-default] Update failed: <NSError: 0x3038b52f0; domain: FBSceneErrorDomain; code: 1 ("operation-failed"); "Scene update failed."> {
    NSUnderlyingError = <NSError: 0x3026896b0; domain: BSServiceConnectionErrorDomain; code: 3 ("OperationFailed"); "XPC error received on message reply handler">;
}
Process state is unknown AppStateTracker, pid 3533, uuid xxxxxxx-xxxxxxx display identifier com.myapp.myapp foreground 1
COSMCtrl _foregroundAppActivity incoming bundle com.myapp.myapp has nil supplied UUID, finds existing xxxxxxxxx-xxxx-xxx-xxx-xxxxxxxx

环境信息

  • 设备:iPhone 12 mini
  • 系统:iOS 18.0
  • 已尝试GitHub上相关解决方案,但无效

求可行的解决思路。

内容的提问来源于stack exchange,提问作者zh24

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 22:33:24