简体   繁体   English

是否必须使用GCM服务来显示推送通知?

[英]Is it mandatory to use GCM service to show push notification?

I am developing a Cordova app having a Java backend. 我正在开发一个具有Java后端的Cordova应用程序。 I want to know if it's mandatory to use GCM service in order to show a push notification in Android/iOS (in notification tray)? 我想知道是否必须使用GCM服务才能在Android / iOS(通知托盘)中显示推送通知?

I am using Apache Kafka, MQTT brokers in my backend. 我在我的后端使用Apache Kafka,MQTT代理。 Is it possible to show push notification using these solutions, ie using completely self defined solutions? 是否可以使用这些解决方案显示推送通知,即使用完全自定义的解决方案?

Using MQTT & other brokers I am able to send realtime data to users but how to show those message as native notification in notification bar is my problem. 使用MQTT和其他代理我能够向用户发送实时数据,但如何在通知栏中显示这些消息作为本机通知是我的问题。

Yes, you will need to use GCM to send push notifications to Android devices. 是的,您需要使用GCM向Android设备发送推送通知。 You can even use GCM to send push notifications to iOS devices (GCM makes request to APNS (Apple push notification service) to make it work). 您甚至可以使用GCM向iOS设备发送推送通知(GCM向APNS(Apple推送通知服务)发出请求以使其正常工作)。

But GCM for iOS isnt trusted much. 但是iOS的GCM并不是很值得信赖。

You can use any backend to send push notification to your devices. 您可以使用任何后端向您的设备发送推送通知。 You just need to make a request to GCM/APNS. 您只需向GCM / APNS提出请求即可。

This is the cordova plugin for push notification. 这是用于推送通知的cordova插件

Integrating with GCM is damn easy, but it takes a little effort with APNS. 与GCM集成非常容易,但APNS需要花费一些精力。

Most people use third party paid services like Pushwoosh to implement their push backend because its convenient. 大多数人使用像Pushwoosh这样的第三方付费服务来实现他们的推送后端,因为它很方便。 There is a free alternative OneSignal but it tracks your usage. 有一个免费的替代OneSignal,但它跟踪您的使用情况。

Follow this guide to setup push for APNS. 按照本指南设置推送APNS。 (You can just use the Setup certificate part from this guide, since you are not using C#) (您可以使用本指南中的安装证书部分,因为您没有使用C#)

要接收推送,您需要使用/实施GCM(实际上是FCM,因为GCM已弃用)要显示来自应用程序的通知,则无需实施GCM / FCM

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

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