带有实时Firebase数据库的FCM消息传递 [英] FCM messaging with Realtime Firebase database

查看:83
本文介绍了带有实时Firebase数据库的FCM消息传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用FireBaserealtime数据库和存储.现在我被推送通知FCM吓到了.请帮助任何人该怎么办.无论如何,没有打开Firebase控制台并将通知发送到设备吗?还是请帮助我发送通过编码通知.

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 and send notification to devices?Or please help me to send notification by coding.

推荐答案

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 应用终止后,通知将不会收到,因此您需要注册接收者才能收到通知

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo 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>

这篇关于带有实时Firebase数据库的FCM消息传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆