简体   繁体   English

Firebase 消息回调之间的区别

[英]Firebase Messaging Difference between callbacks

I'm having a hard time finding any site that clearly explains the differences between the firebase messaging callbacks of onBackgroundMessage, onLaunch, and onResume.我很难找到任何可以清楚地解释 onBackgroundMessage、onLaunch 和 onResume 的 firebase 消息回调之间差异的站点。 These words may seem common sense but they are not.这些话似乎是常识,但事实并非如此。 I need a clear explanation of the differences between these callbacks.我需要清楚地解释这些回调之间的差异。 In what situations are these callbacks used?在什么情况下使用这些回调?

As far as I know, Firebase Cloud Messaging is not only used for sending Notifications.据我所知,Firebase 云消息不仅用于发送通知。
With FCM, you can send two types of messages to clients:使用 FCM,您可以向客户端发送两种类型的消息:
Notification messages sometimes thought of as "display messages."通知消息有时被认为是“显示消息”。 These are handled by the FCM SDK automatically.这些由 FCM SDK 自动处理。
Data messages , which are handled by the client app.数据消息,由客户端应用程序处理。 在此处输入图像描述

This Official Documentation explains it all.这个官方文档解释了这一切。
Functions Reference: https://pub.dev/packages/firebase_messaging#receiving-messages函数参考: https://pub.dev/packages/firebase_messaging#receiving-messages
Message Types Reference: https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages消息类型参考: https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages

暂无
暂无

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

相关问题 Firebase 云消息传递和 Firebase 应用内消息传递有什么区别 - What is the difference between Firebase Cloud Messaging and Firebase In-App Messaging firebase云消息传递和firebase通知之间有什么区别? - What's the difference between firebase cloud messaging & firebase notifications? Firebase中的应用程序内消息和应用程序内消息显示有何区别 - What is the difference between In-App Messaging and In-App Messaging Display in Firebase firebase_messaging_web 和 firebase_messaging 有什么区别,跨平台项目应该使用哪个? - what's the difference between firebase_messaging_web and firebase_messaging, which one should be used for crossplatform projects? 从延迟和安全角度看,Firebase云消息传递类型之间有何区别? - What is the difference between Firebase cloud messaging types from latency and security perspectives? “firebase-messaging”和“firebase-inappmessaging-display”之间有什么区别? - what is the deference between "firebase-messaging" and "firebase-inappmessaging-display"? Firebase消息传递 - Firebase Messaging firebase的addValueEventListener()和addListenerForSingleValueEvent()之间的区别 - Difference between addValueEventListener() and addListenerForSingleValueEvent() of firebase exportVal() 和 val() firebase 的区别? - difference between exportVal() and val() firebase? 普通 firebase 和 firebase admin sdk 之间的区别 - Difference between normal firebase and firebase admin sdk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM