Android FCM错误FirebaseInstanceId:传递消息时出错:未找到ServiceIntent
FCM通知在应用程序打开时起作用,但当我关闭应用程序并将其从最近的应用程序中删除时,通知在30秒或1分钟后起作用,当我发送通知时,通知不起作用并在logcat中显示错误Android FCM错误FirebaseInstanceId:传递消息时出错:未找到ServiceIntent,android,firebase,notifications,firebase-cloud-messaging,Android,Firebase,Notifications,Firebase Cloud Messaging,FCM通知在应用程序打开时起作用,但当我关闭应用程序并将其从最近的应用程序中删除时,通知在30秒或1分钟后起作用,当我发送通知时,通知不起作用并在logcat中显示错误 FirebaseInstanceId: Error while delivering the message: ServiceIntent not found. 首先,确保已将依赖项添加到firebase消息传递和 您的接收器正确,如图所示: 应用程序内模块的build.gradle: implementation 'com
FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
首先,确保已将依赖项添加到firebase消息传递和 您的接收器正确,如图所示: 应用程序内模块的build.gradle:
implementation 'com.google.firebase:firebase-messaging:the-version
在AndroidManifest.xml中:
<service
android:name=".java.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
你说的是来自设备的上行消息还是来自服务器/其他来源的下行消息?下行消息那么这是否意味着设备上的
onMessageReceived
仍然被调用,但不知何故它仍然不起作用?我不太清楚具体情况是什么。不,在设备上接收到的消息未被调用。此错误是否来自发送端,或者应用程序在收到消息时仍在响应,但只是用此错误消息进行响应?如果是后者,我怀疑你发送的信息有问题。您是发送数据消息还是普通消息?
<service
android:name=".GCM.PushNotificationService"
android:exported="false">
<intent-filter android:priority="10000">
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>