Flutter app crashes on open from chilly state with Department.io deep hyperlink

0
29
Flutter app crashes on open from chilly state with Department.io deep hyperlink


I just lately carried out deep linking with Department.io for my flutter app working on iOS. It really works as anticipated when the app is working within the background. When the Department.io hyperlink is clicked, it should open in my Flutter app. Nonetheless, when the app is totally closed and in a chilly state, tapping the hyperlink will start to redirect to the applying however then the app crashes instantly.

That is my code for creating and opening deep hyperlinks:

static Future hear(BuildContext context) async {
    await FlutterBranchSdk.init();
    StreamSubscription? streamSubscription;

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

  // Following this information: 
  // https://seayeshaiftikhar.medium.com/branch-io-for-deep-linking-in-flutter-2327530f1639
  static Future createLink(String groupId) async {
    BranchUniversalObject branchUniversalObject = BranchUniversalObject(
        canonicalIdentifier: 'flutter/department',
        contentMetadata: BranchContentMetaData()
          ..addCustomMetadata('groupId', groupId),);
    FlutterBranchSdk.registerView(buo: branchUniversalObject);
    BranchLinkProperties linkProperties =
        BranchLinkProperties(function: 'sharing');
    linkProperties.addControlParam('$uri_redirect_mode',
        '1'); // this may redirect the hyperlink to software

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

I made positive to run FlutterBranchSdk.validateSDKIntegration(); and all of the checks handed – my Information.plist file configuration seems to be appropriate.

Anything look amiss?

I used to be capable of watch my gadget’s output with Mac’s Console app, and when the app crashes, I see some error messages like this:

[(FBSceneManager):sceneID:com.myapp.myapp-default] Replace failed:  {
    NSUnderlyingError = ;
}
Course of state is unknown AppStateTracker, pid 3533, uuid xxxxxxx-xxxxxxx show identifier com.myapp.myapp foreground 1
COSMCtrl _foregroundAppActivity incoming bundle com.myapp.myapp has nil equipped UUID, finds current xxxxxxxxx-xxxx-xxx-xxx-xxxxxxxx

I additionally tried following this resolution to no success.

Operating on iPhone 12 mini with iOS 18.0. Any concepts?

LEAVE A REPLY

Please enter your comment!
Please enter your name here