简体   繁体   English

离子推送通知(背景信息)

[英]Ionic Push notification(Background fone)

Hi guys I have ionic application.Where users can send each other messages.It works fine but I want to create push notification for Background fone. 嗨,大家好,我有离子应用程序。用户可以在其中互相发送消息。它工作正常,但我想为Background Fone创建推送通知。

I inistigated Onesignal but it hardly for using. 我指示Onesignal,但几乎不使用。 And I read that I need keep all users list on them server( https://onesignal.com/ ). 我读到我需要将所有用户列表保留在他们的服务器上( https://onesignal.com/ )。 I have server and backend created by nodeJs. 我有由nodeJs创建的服务器和后端。

Could you suggest me other approach. 你能建议我其他方法吗?

Thanks Hakob 谢谢哈科布

There are various plugins for push notifications. 有各种用于推送通知的插件。 You need to install them locally on the app and use them as the clients to register to the server and keep receiving notifications. 您需要在应用程序本地安装它们,并将它们用作客户端以注册到服务器并继续接收通知。

You can refer ionic or cordova documentations for the details as it is not apt to mention all the details here. 您可以参考ioniccordova文档获取详细信息,因为此处不愿提及所有详细信息。

Brief steps- 简短步骤-

  1. First you need to configure the server for ex - Firebase Cloud Messenging (FCM) . 首先,您需要为前Firebase Cloud Messenging(FCM)配置服务器。
  2. Install the plugin and deal with the notifications actions(onregister, onreceive, etc.) in the code. 安装插件并处理代码中的通知动作(onregister,onreceive等)。
  3. Next, use the server authorization keys got from Step-1 in the plugin code on the app. 接下来,在应用程序的插件代码中使用从步骤1获得的服务器授权密钥。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM