Firebase onMessageReceived not called when app in background

前端 未结 26 2685
粉色の甜心
粉色の甜心 2020-11-22 02:32

I\'m working with Firebase and testing sending notifications to my app from my server while the app is in the background. The notification is sent successfully, it even appe

26条回答
  •  心在旅途
    2020-11-22 03:04

    you can try this in your main Activity , when in the background

       if (getIntent().getExtras() != null) {
                for (String key : getIntent().getExtras().keySet()) {
                    Object value = getIntent().getExtras().get(key);
                    Log.d(TAG, "Key: " + key + " Value: " + value);
                }
            }
    

    Check the following project as reference

提交回复
热议问题