我在 Android 上使用 Firebase 云消息传递.
I am using Firebase Cloud Messaging on Android.
我的清单中有以下内容:
I have the following in my manifest:
<service android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name=".MyInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
这是关于扩展 FirebaseMessagingService 的文档所说的:
This is what the documentation has to say about extending FirebaseMessagingService:
如果您想要在后台接收应用通知之外的任何消息处理,则这是必需的.
This is required if you want to do any message handling beyond receiving notifications on apps in the background.
在后台接收应用程序通知之外的消息处理"是什么意思并不完全清楚.我只能假设他们在谈论关闭应用程序时处理消息.
It's not entirely clear what they mean by "message handling beyond receiving notifications on apps in the background". I can only assume that they are talking about handling messages when the app is closed.
任何帮助将不胜感激.
如果您强制停止应用程序,则在 应用程序重新启动之前您不会收到任何通知.在重新启动应用程序之前,您的任何代码都不会工作.
If you force stop an app you don't get any notifications until the app is restarted. None of your code will work until the app is restarted.
应用的所有服务也将停止,直到用户再次手动启动应用
All services of the app will also be stopped until user manually launches the app again
这篇关于应用程序处于非活动状态时未调用 Firebase onMessageReceived的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!