Firebase Cloud Messagingの実装について

https://github.com/firebase/quickstart-android/issues/83#issuecomment-261238532

I had this problem because I thought that all messages with notification and data fields filled will be received by play services and displayed on notification bar if application is backgrounded or killed.

But it is not working this way!

Event if application was killed (swiped out) or application is in background mode and device is in sleep mode notifications are received all the time but once in notification bar and another time in method public void onMessageReceived(RemoteMessage remoteMessage) inside application - it is random.

My test was based on playing sounds when push notification was received - I didn't hear a sound in onMessageReceived method because I didn't implement it at all.

Now my application receives 100% messages from two sources - notification bar and by handling onMessageReceived method.

It's good tutorial about how to start with firebase messaging. Works as expected.