为动态链接添加ofl firebaseFlutter

zz2j4svz  于 2023-01-14  发布在  Flutter
关注(0)|答案(1)|浏览(111)

我想添加ofl,以便在桌面上打开链接时,链接将转到应用程序的Web版本
这是我的代码,我应该把它添加到哪里?

final DynamicLinkParameters parameters = DynamicLinkParameters(
      // The Dynamic Link URI domain. You can view created URIs on your Firebase console
      uriPrefix: uriPrefix,

      // The deep Link passed to your application which you can use to affect change
      link: Uri.parse(parsableLink),
      // Android application details needed for opening correct app on device/Play Store
      androidParameters: AndroidParameters(
          packageName: androidPackageName, fallbackUrl: Uri.parse(webLink)),

      // iOS application details needed for opening correct app on device/App Store
      iosParameters: IOSParameters(
          bundleId: iosPackageName, fallbackUrl: Uri.parse(webLink)),

      //longDynamicLink: Uri.parse('$parsableLink&ofl=$webLink')
    );

    final ShortDynamicLink shortDynamicLink =
        await dynamicLinks.buildShortLink(parameters);
    print(shortDynamicLink);

    return shortDynamicLink.shortUrl.toString();
watbbzwu

watbbzwu1#

好吧,我想我必须像这样添加longDynamicLink:

"$uriPrefix/?link=$parsableLink&apn=$androidPackageName&afl=$webLink&ibi=$iosPackageName&isi=$iosId&ifl=$webLink&ofl=$webLink"

相关问题