Firebase Notification not working on Android

After buying from codecanyon, I configure the app properly and everyone was working fine but Firebase notification is not working.

First of all check the setup then must test on a real device and if everything was fine and you don’t get then don’t worry about it. Some time firebase takes some time after publishing the app it will auto resolved.

Step 1: Must register firebase with your applicationID and update the firebase file. Watch the video for more: https://youtu.be/duV0KSK2Q28

Step 2. Enable permission for the notification. You can also add this,

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> 
<uses-permission android:name="android.permission.WAKE_LOCK" />
    <service android:name=".setting.FirebaseMessagingService"
        android:permission="false">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@mipmap/ic_launcher" />
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@color/colorAccent" />
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="@string/default_notification_channel_id" />
    <meta-data
        android:name="firebase_messaging_auto_init_enabled"
        android:value="true" />
    <meta-data
        android:name="firebase_analytics_collection_enabled"
        android:value="true" />

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        </intent-filter>
    </receiver>

Step 3: Add this line on MainActivity.kt

    FirebaseMessaging.getInstance().isAutoInitEnabled = true

6 thoughts on “Firebase Notification not working on Android

  1. gimfy says:

    Hi,

    how does it work with device registration? Virtual device does not ask for authorization (I get Message “you have reached you limit subscribe today”). When I click it, I get the message. “real” device does not recieve the message at all… Is there a way to check this? Also the App icon is missing on VAD…

Leave a Reply