簡體   English   中英

深度鏈接不包含有效的必需參數 - Flutter 和 Firebase 動態鏈接

[英]Deep Link does not contain valid required params - Flutter with Firebase Dynamic Link

我在我的 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";
}

下面是我的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 

這個問題似乎出現在舊版本的 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();
}

然后使用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

      }
    },
  );
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM