Это мой код для создания и открытия глубокие ссылки:
Код: Выделить всё
static Future listen(BuildContext context) async {
await FlutterBranchSdk.init();
StreamSubscription? 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}');
});
}
// Following this guide:
// https://seayeshaiftikhar.medium.com/branch-io-for-deep-linking-in-flutter-2327530f1639
static Future 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);
}

Мне удалось просмотреть выходные данные моего устройства с помощью приложения Mac Console, и когда приложение выходит из строя, я увидеть некоторые сообщения об ошибках, подобные этому:
Код: Выделить всё
[(FBSceneManager):sceneID:com.myapp.myapp-default] Update failed: {
NSUnderlyingError = ;
}
Код: Выделить всё
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. Есть идеи?
Подробнее здесь: https://stackoverflow.com/questions/790 ... -deep-link