android-Firebase通知在Android 9.1中未收到

问题描述 投票:-1回答:1

我有一个装有android 9.1的手机。问题是它没有收到firebase通知。我已经在其他手机上测试了完全相同的应用程序,它们确实可以正常工作,但是在此特定版本中,它无法正常工作。

这是我的代码

public class FCMService extends FirebaseMessagingService {
private static final String TAG = "this";

@Override
public void onNewToken(String s) {
    super.onNewToken(s);
}

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    if (remoteMessage.getNotification() != null) {
        sendMessageToActivity(remoteMessage.getNotification().getBody());
    }
}

private void sendMessageToActivity(String body) {
    .......
}

}

再次,它在其他版本(例如android 8甚至android 9,但在android 9.1中却无法正常工作)>

这是关于电话的屏幕:

enter image description here

我有一个装有android 9.1的手机。问题是它没有收到firebase通知。我已经在其他手机上测试了完全相同的应用程序,并且它们确实工作正常,但是在此特定版本中,它是......

android firebase firebase-cloud-messaging android-notifications
1个回答
1
投票

如果应用程序在前台或在后台运行(不可见,但在任务管理器上可用,它将收到通知。

© www.soinside.com 2019 - 2024. All rights reserved.