Skip to content Skip to sidebar Skip to footer

Fcm Messaging With Realtime Firebase Database

My app using FireBaserealtime database and storage.Now i am struck in the part of push notification FCM.Please help anyone how to do.Is there anyway,without open firebase console a

Solution 1:

You can use Advance Rest client to send a notification to the device.
Use the link to add extension to chrome

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo enter image description here Notification will not receive when app kill, thus you need to Register Receiver to get Notification

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class OnBootBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent)
    {
    Intent i = new Intent("com.android.pushnotify.MyFirebaseMessagingService");
        i.setClass(context, MyFirebaseMessagingService.class);
        context.startService(i);
    }
}

add inside Manifest.xml(Application tag)

 <receiver android:name="com.androidbash.androidbashfirebasepushnotify.OnBootBroadcastReceiver">
            <intent-filter >
                <action android:name="android.intent.action.BOOT_COMPLETED" />

                <category android:name="android.intent.category.HOME" />
            </intent-filter>
 </receiver>

Post a Comment for "Fcm Messaging With Realtime Firebase Database"