【发布时间】:2020-02-15 18:34:36
【问题描述】:
flutter中如何从firebase动态链接接收参数?
我创建了一个短网址:
指向
但我想添加一个 url 查询参数,例如:
https://example.com/view-product?id=56
请注意,“56”是可变的,并且会在应用流程中动态变化。我无法接收到这个“id”参数。
在浏览器上我尝试输入https://subdomain.example.com/product?id=56
我收到了链接:https://example.com/view-product
FirebaseDynamicLinks.instance.onLink(
onSuccess: (PendingDynamicLinkData dynamicLink) async {
final Uri deepLink = dynamicLink?.link;
showModalBottomSheet(context: context, builder: (context){
return Container(
height: 100.0,
child: Text(deepLink.toString()),
);
});
if (deepLink != null) {
debugPrint("Link found on line: "+deepLink.queryParameters.toString());
}
}, onError: (OnLinkErrorException e) async {
print('onLinkError');
print(e.message);
});
【问题讨论】:
-
您需要按照文档中的说明构建链接。
-
@creativecreatorormaybenot 我看不懂文档。我需要在运行时创建链接吗?我应该如何使用 Firebase 控制台?
-
@creativecreatorormaybenot 你能帮上忙吗?谢谢
标签: firebase flutter dart firebase-dynamic-links