Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android FCM错误FirebaseInstanceId:传递消息时出错:未找到ServiceIntent_Android_Firebase_Notifications_Firebase Cloud Messaging - Fatal编程技术网

Android FCM错误FirebaseInstanceId:传递消息时出错:未找到ServiceIntent

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

FCM通知在应用程序打开时起作用,但当我关闭应用程序并将其从最近的应用程序中删除时,通知在30秒或1分钟后起作用,当我发送通知时,通知不起作用并在logcat中显示错误

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>