androidfirebasepush-notificationfirebase-cloud-messagingscreen-lock

Firebase notifications on Android phone with screen lock


We develop an android app to show Firebase notification to user. The implementation is working very well in emulator everything is works fine, no problem.

My code is similar which is on firebase site: https://firebase.google.com/docs/cloud-messaging/android/client.

What should I do?

Thanks


Solution

  • To send normal notifications to the app using Firebase Cloud Messaging, code is not required.

    Just add the following dependencies:

    implementation 'com.google.firebase:firebase-core:17.3.0'
    implementation 'com.google.firebase:firebase-analytics:17.3.0' 
    implementation 'com.google.firebase:firebase-messaging:20.1.5'
    

    And create a new notification like this.

    enter image description here

    It looks like Your messaging service may be misbehaving.. or check if you have latest dependencies installed.