shr*_*ari 8 xcode ios firebase flutter firebase-dynamic-links
我在我的 flutter 应用程序中使用 Firebase 动态链接。我允许用户在应用程序中生成动态链接,可以通过短信/电子邮件/whatsApp 等共享。此链接对于 Android 运行良好,但对于 iOS 我收到此异常。
提前致谢。
下面是我的 Xcode 日志。
[Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
"_cpb" = 1;
"_cpt" = cpit;
"_fpb" = "XXAHEJ4DGgVlbXXXXX==";
"_iumchkactval" = 1;
"_iumenbl" = 1;
"_osl" = "https://app.XXXXXXX.com/PPZbgKsKpKvukDWZ8";
"_plt" = 1400;
"_uit" = 1400;
amv = 1;
apn = "com.xxx.xxxx";
cid = 000000;
ibi = "com.xxx.xxxx";
imv = 1;
isi = X4967XXXXX;
link = "https://app.xxxxx.com/data?userid=Bzhm1TScavV2&refcode=3DWIN11329206";
}
Run Code Online (Sandbox Code Playgroud)
以下是我的 Firebase 动态链接详细信息
Link name
Invite Friends
Deep link
https://app.xxxxx.com/data?userid=Bzhm1TScavV2&refcode=WIN11329206
Android app
com.xxx.xxxx
iOS app
com.xxx.xxxx
Long Dynamic Link
https://app.xxxxx.com/?link=https://app.xxxxx.com/data?userid%3DBzhm1TScavV2%26refcode%3DWIN11329206&apn=com.xxx.xxxx&isi=X4967XXXXX&ibi= com.xxx.xxxx
Short Dynamic Link
https://app.xxxxx.com/invitefriends
Run Code Online (Sandbox Code Playgroud)
如本问题票中所述,此问题似乎存在于旧版本的 firebase_dynamic_links 上。此问题的解决方法是在 iOS 中启动链接时使用app_links 。
import 'dart:io' show Platform;
...
if (Platform.isIOS) {
// Handle link using app_links in iOS
initDynamicLinksIOS();
}
else {
// Use the firebase_dynamic_links per usual
initDynamicLinksAndroid();
}
Run Code Online (Sandbox Code Playgroud)
然后用来app_links
处理iOS中的深层链接。
initDynamicLinkIOS() async {
final _appLinks = AppLinks(
// Called when a new uri has been redirected to the app
onAppLink: (Uri deepLink) async {
final PendingDynamicLinkData data =
await FirebaseDynamicLinks.instance.getDynamicLink(deepLink);
deepLink = data?.link;
if (deepLink != null) {
debugPrint('$deepLink');
// Handle the deep link
}
},
);
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2226 次 |
最近记录: |