Android 允许自动启动后,FCM通知在oppo(彩色操作系统)中不起作用
我在android应用程序中使用FCM。当应用程序位于后台但从后台终止后,通知工作正常。通知不工作 我的手机是oppo f9 pro 我已经在后台手动启用了自动启动和允许 在后台启用Android 允许自动启动后,FCM通知在oppo(彩色操作系统)中不起作用,android,push-notification,firebase-cloud-messaging,Android,Push Notification,Firebase Cloud Messaging,我在android应用程序中使用FCM。当应用程序位于后台但从后台终止后,通知工作正常。通知不工作 我的手机是oppo f9 pro 我已经在后台手动启用了自动启动和允许 在后台启用 { "notification":{"title":"testing of notification - new ","body":"body of notification ","sound":"Enabled" }, "data":{ "id":74, "callFrom":"test",
{
"notification":{"title":"testing of notification - new ","body":"body of notification ","sound":"Enabled"
},
"data":{
"id":74,
"callFrom":"test",
"other_info":"other detail in other info"
},
"to":"c5V-l4poMYI:APA91bFk8DO6upFN9dSXjI3d9UXpRUvmdzPo9OyUV9LnLJhCA6vBQ4y6TuXWHg1vaGM0SV6bEOLDW38UFEsVhcHFRvT7oIkGNmtd2v6516ABh6MyvkuoFP7gwUJWOPQRCaPsVg8_O2ot"
}
我的Firebase服务
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "myFirebaseMsgService";
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Log.d(TAG, "From : " + remoteMessage.getFrom());
if (remoteMessage.getData().size() > 0) {
Log.d(TAG, "Message Data : " + remoteMessage.getData());
}
if (remoteMessage.getNotification() != null) {
}
}
}
发送有效负载
{
"notification":{"title":"testing of notification - new ","body":"body of notification ","sound":"Enabled"
},
"data":{
"id":74,
"callFrom":"test",
"other_info":"other detail in other info"
},
"to":"c5V-l4poMYI:APA91bFk8DO6upFN9dSXjI3d9UXpRUvmdzPo9OyUV9LnLJhCA6vBQ4y6TuXWHg1vaGM0SV6bEOLDW38UFEsVhcHFRvT7oIkGNmtd2v6516ABh6MyvkuoFP7gwUJWOPQRCaPsVg8_O2ot"
}
当你发送信息时,logcat信息是什么?