flutter 如何调用 firebase 的服务: storage , cloud message 等

  •  添加到 Android :

https://firebase.google.com/docs/android/setup

 

  • medium 网站的讲解

https://medium.com/@SebastianEngel/easy-push-notifications-with-flutter-and-firebase-cloud-messaging-d96084f5954f

 

  • 如何发通知

To send a message to a specific device, you need to know that device’s registration token (注册令牌)

 

  • 如何接通知:

具体的实现 : https://medium.com/@jun.chenying/flutter-tutorial-part3-push-notification-with-firebase-cloud-messaging-fcm-2fbdd84d3a5e

 

  • 接到通知后, 如何转到特定页

先阅读flutter route 的 文档  : https://flutter.dev/docs/cookbook/navigation

https://stackoverflow.com/questions/48403786/how-to-open-particular-screen-on-clicking-on-push-notification-for-flutter  

这个似乎不对

 


另一种方法:

https://stackoverflow.com/questions/53408967/open-certain-page-on-push-notification-using-firebase-cloud-messaging-on-flutter

 

 

上面的解决方法中 ,这个消息怎么发 :

 

    • in case  no context , How to navigator ?

https://medium.com/flutter-community/navigate-without-a-buildcontext-in-flutter-code-guide-2d344ee0e4d6