Flutter是否支持Firebase动态链接?

时间:2018-05-02 09:49:52

标签: firebase dart flutter firebase-dynamic-links

如果是,如何在Flutter中实施Firebase动态链接?我希望用户在iOS或Android上打开动态链接,然后可以将它们直接转到我应用中的链接内容。

2 个答案:

答案 0 :(得分:1)

现在支持Firebase动态链接!
链接到发布商页面:https://pub.dartlang.org/packages/firebase_dynamic_links

答案 1 :(得分:0)

这是深层次的联系。是的,你可以在Flutter中完成。我找到了一个处理程序的示例代码。您应该在应用程序路由中设置此处理程序。

/// Handles deep links into the app
/// To test on Android:
/// 
/// `adb shell am start -W -a android.intent.action.VIEW -d "fluro://deeplink?path=/message&mesage=fluro%20rocks%21%21" com.goposse.fluro`
var deepLinkHandler = new Handler(handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  String message = params["message"]?.first;
  String colorHex = params["color_hex"]?.first;
  String result = params["result"]?.first;
  Color color = new Color(0xFFFFFFFF);

  if (colorHex != null && colorHex.length > 0) {
    color = new Color(ColorHelpers.fromHexString(colorHex));
  }

  return new DemoSimpleComponent(message: "DEEEEEP LINK!!!", color: color, result: result);  
});

来源:https://github.com/goposse/fluro/tree/master/example