【问题标题】:FCM messaging with Realtime Firebase database使用实时 Firebase 数据库的 FCM 消息传递
【发布时间】:2017-05-06 04:17:35
【问题描述】:

我的应用程序使用 FireBaserealtime 数据库和存储。现在我对推送通知 FCM 的部分感到震惊。请帮助任何人怎么做。无论如何,没有打开 Firebase 控制台并向设备发送通知?或者请帮我发送通过编码通知。

【问题讨论】:

标签: android firebase-realtime-database


【解决方案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 应用kill时不会收到通知,因此您需要注册接收器才能获得通知

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 Db中分享查询,我有一些想法..但不能完全理解。请在那部分帮助我。
  • 您可以使用firebase控制台或Advance rest客户端将通知发送到设备,并已将其添加到答案中。
  • 我在询问 Firebase 数据库查询。我是 FireBase 的新手
  • 但是这是通知部分,不需要实现DB Query。
猜你喜欢
  • 2019-01-19
  • 2020-01-29
  • 2019-05-14
  • 2017-03-23
  • 2022-01-09
  • 2021-01-19
  • 2017-03-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多