如何使用go_router使用Flutter Firebase动态链接
我有firebase
动态链接
在我的应用中集成并正常工作,后来我更改为使用go_router
,现在我不知道该怎么办做它可以正常工作或如何处理。
我想象的方式是,FB动态链接PATH
将与path
的gorouter
中的页面相同。路由
,而go_router将自动自动重定向,但我认为这不是其工作方式,我找不到任何资源。
因此,问题是如何使用使用
使用
go_router
使用firebase dynamiclinks
?
I had firebase
dynamic links
integrated and working fine in my app and later i changed to use go_router
and now i don't know what i should do to get it working or how to handle it.
The way i imagined it would be is that the FB dynamic link path
will be the same as the path
to the page in GoRouter
routes
, and go_router will redirect
to the page automatically but i don't think that is how it works and i can't find any resources for this.
So the question is how to use Firebase DynamicLinks
with go_router
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我的做法,看起来工作正常:)
当应用处于终止模式时:
future main()async {
...
...
然后通过runapp(mtapp(initialRoute:initialLink))将其传递给gorouter.initiallocation字段或gorouter.redirect函数,具体取决于您的使用方式。
将您的顶级小部件用您创建的状态窗包装,例如:
ahdynamiclinksmanager cass fording
希望它能有所帮助!
this is how I did it, looks like working fine :)
For when the app is in terminated mode:
Future main() async {
...
...
then through runApp(MtApp(initialRoute: initialLink)) pass it to GoRouter.initialLocation field or GoRouter.redirect function, depending on how you use it.
wrap your top widget with a statefulWidget your created like:
class AHDynamicLinksManager extends
Hope it helped!