My device does not receive other notifications (FCM)

I switched to Firebase Cloud Messaging, and when I tried to send a message, I received a notification using the console in Firebase, and then tried to send another notification after a few minutes, but I no longer receive another notification, but in my firebase console it says It was Completed

Update

Here is my code

Mainactivity

public class MainActivity extends Activity {
 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

 checkPlayServices();

 Log.i(TAG, "InstanceID token: " + FirebaseInstanceId.getInstance().getToken());

}
....
}

MyFirebaseInstanceIDService

public class MyFirebaseInstanceIDService  extends FirebaseInstanceIdService {

@Override
public void onTokenRefresh() {
    // Get updated InstanceID token.
    String refreshedToken = FirebaseInstanceId.getInstance().getToken();
    Log.d(TAG, "Refreshed token: " + refreshedToken);

    sendRegistrationToServer(refreshedToken);
}
}

MyFirebaseMessagingService

public class MyFirebaseMessagingService  extends FirebaseMessagingService {

private static final String TAG = "MyFirebaseMsgService";


// [START receive_message]
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {

    Log.d(TAG, "From: " + remoteMessage.getFrom());
    Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
}
// [END receive_message]

it seems that other devices are accepting it, but other devices have not received it.

+4
source share
1 answer

- AdamK, , , , , .

, onMessageReceived(), , , onMessageReceived(). , , onMessageReceived() .

sendNotification() onMessageReceived():

sendNotification(remoteMessage.getNotification().getBody());

, .

+1

All Articles