Android Code Snippet Using FCM on Huawei phones: Set your app to "protected" (important!)

By default on Huawei phones all "unknown apps" (like your app is for sure) are NOT allowed to run in the background (= when the screen turns off OR your app is sent "to the back" by pressing the home button or by any other event). So when your app is paused, the complete app is stopped. Even the FCM service is completely inactive.

As a result of that you are NOT able to receive any FCM messages anymore. It took me hours wondering why my phone app (Huawei P8, Android 6.x) does not receive messages.

There's a feature called "protected apps". Only apps which are "protected" will be able to run in the background.

If you release your app to the PlayStore please notify your users about that.

See this thread: https://android.stackexchange.com/questions/152649/what-is-protected-apps-in-huawei-phones
 
Top