ios上的Firestore动态链接崩溃



该代码在android设备上运行良好,但在ios设备上不起作用。

我的代码:

String userId = uid;
final DynamicLinkParameters dynamicLinkParameters = DynamicLinkParameters(
uriPrefix: 'https://mywebsite.com/user/',
link: Uri.parse(
'https://mywebsite.com/link/?username=$userId',
),
);
final ShortDynamicLink shortDynamicLink = await dynamicLink.buildShortLink(
dynamicLinkParameters,
shortLinkType: ShortDynamicLinkType.short,
);

错误消息:

flutter: type 'int' is not a subtype of type 'String' in type cast
2022-07-29 22:30:23.235625+0300 Runner[51971:280704] flutter: 
#0 new LinkedHashMap.from.<anonymous closure> (dart:collection/linked_hash_map.dart:187:26)
#1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:614:13)
#2 new LinkedHashMap.from (dart:collection/linked_hash_map.dart:186:11)
#3 platformExceptionToFirebaseException  (package:firebase_dynamic_links_platform_interface/src/method_channel/utils /exception.dart:32:9)
#4 convertPlatformException  (package:firebase_dynamic_links_platform_interface/src/method_channel/utils/exception.dart:17:5)
#5 MethodChannelFirebaseDynamicLinks.buildShortLink (package:firebase_dynamic_links_platform_interface/src/method_channel/method_channel_firebase_dynamic_links.dart:196:7)

我通过更改来处理它

来自

uriPrefix: 'https://mywebsite.com/user/',

uriPrefix: 'https://mywebsite.com/user',

尝试更改

String userId = uid;

int userId = uid;

最新更新