简体   繁体   English

Flutter 上的 Firebase 动态链接

[英]Firebase Dynamic Link on Flutter

I currently struggle with Firebase Dynamic Links on Flutter.我目前在 Flutter 上使用 Firebase 动态链接。 I followed the documentation and ended up with my own version:我遵循了文档并最终得到了我自己的版本:

final DynamicLinkParameters parameters = DynamicLinkParameters(
    uriPrefix: 'https://myapp.page.link',
    link: Uri.parse('https://myapp.page.link/'+Provider.of<FirebaseUser>(context).uid),
    androidParameters: AndroidParameters(
        packageName: 'com.me.myapp',
        minimumVersion: 0,
    ),
    iosParameters: IosParameters(
        bundleId: 'com.me.myapp',
        minimumVersion: '0',
        appStoreId: '123456789',
    ),
    socialMetaTagParameters:  SocialMetaTagParameters(
        title: 'Yay',
        description: 'Click me'
    ),

);

final Uri dynamicUrl = await parameters.buildUrl();

Now I got few questions:现在我有几个问题:

  1. What is the uriPrefix?什么是uriPrefix? Does it need to be a legit one?它需要是合法的吗?
  2. Can I just use the required information in the link, or does it also need to contain the namespace?我可以只在链接中使用所需的信息,还是还需要包含命名空间?
  3. The minimumVersion is defined by Flutter. minimumVersion 由 Flutter 定义。 In my case it is 1.0.0+9, but the field for Android is expecting a number, while iOS is expecting a String.就我而言,它是 1.0.0+9,但 Android 的字段需要一个数字,而 iOS 需要一个字符串。 What should I place in there?我应该在里面放什么?
  4. What is the disadvantage of using ShortDynamicLink?使用 ShortDynamicLink 的缺点是什么?
  5. Do I also need the parameters for Google Analytics and iTunes?我是否还需要 Google Analytics 和 iTunes 的参数? What are they for?它们是为了什么?
  6. Where is the correct place to read the data from the link?从链接读取数据的正确位置在哪里? The initState() method of my LandingPage (which is the home-property of my ThemeData) is not called when the link opens the app.当链接打开应用程序时,不会调用我的 LandingPage(这是我的 ThemeData 的主页属性)的 initState() 方法。
  1. uriPrefix - This is your apps unique link which you can find on firebase console. uriPrefix - 这是您的应用程序唯一链接,您可以在 firebase 控制台上找到它。 Just browse to Firebase console > Dynamic link > and you get a link with something like https://xcvnm.app.goo.gl/ .That is the uriPrefix.只需浏览到 Firebase 控制台 > 动态链接 > 就会得到一个类似https://xcvnm.app.goo.gl/的链接。这就是 uriPrefix。

  2. You should only use the required information in your app.您应该只在您的应用中使用所需的信息。 All the fields are there for different behaviours and use case.所有字段都用于不同的行为和用例。

  3. MinimumVersion The versionCode of the minimum version of your app that can open the link.最小版本 可以打开链接的应用程序的最低版本的 versionCode。 If the installed app is an older version, the user is taken to the Play Store to upgrade the app.如果安装的应用程序是旧版本,用户将被带到 Play 商店升级应用程序。 ( So if you are making a new app then you don't need to use this property.) (所以如果你正在制作一个新的应用程序,那么你不需要使用这个属性。)

  4. There is not much difference in short dynamic link短动态链接差别不大

  5. The correct place depends on your apps structure and your preference, so can't suggest that.正确的位置取决于您的应用程序结构和您的偏好,所以不能建议。

For more detail visit - https://firebase.google.com/docs/dynamic-links/android/create有关更多详细信息,请访问 - https://firebase.google.com/docs/dynamic-links/android/create

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter firebase 动态链接不听 - Flutter firebase dynamic link not listening 处理链接并使用 flutter 中的 firebase 动态链接导航 - handle link and navigate with firebase dynamic links in flutter Firebase 与 flutter 动态链接:深层链接 URL 未打开应用程序 - Firebase dynamic link with flutter: Deep link URL doesnt open app Flutter iOS Firebase 带链接值的动态链接推送命名页面 - Flutter iOS Firebase dynamic link push named page with the link value firebase 无密码身份验证如何与 Flutter 应用程序的动态链接一起使用? - How does firebase passwordless authentication work with dynamic link for a flutter app? Flutter firebase 动态链接社交标签信息根本不显示 - Flutter firebase dynamic link social tags info not showing at all Flutter - Firebase 当应用处于终止模式时动态链接不工作 - Flutter - Firebase Dynamic Link not Working while app is in kill mode Flutter - Firebase 动态链接没有被onLink捕获但是在iOS上打开应用 - Flutter - Firebase Dynamic Link is not caught by onLink but open the app on iOS 如果应用程序已经在运行,Flutter 如何获取 firebase 动态链接? - Flutter how to get firebase dynamic link if app is already running? Flutter Firebase Dynamic Link Navigator.push 不导航 - Flutter Firebase Dynamic Link Navigator.push not navigating
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM