简体   繁体   English

定位推送通知

[英]Targeting Push Notifications

I have an idea for an application and am trying to first get hold of a plan to implement it. 我对应用程序有一个想法,正在尝试首先掌握实现它的计划。 I am planning to implement a java service on Google App Engine and this would be pushing messages to subscribers, i have a concept of channels, exactly the same thing Parse has. 我打算在Google App Engine上实现Java服务,这会将消息推送给订阅者,我有一个通道概念,与Parse完全一样。 Unfortunately Parse is not supported on GAE and it only has an Android client. 不幸的是,GAE不支持Parse,它只有一个Android客户端。

Does GCM have channel based push notifications? GCM是否有基于频道的推送通知? Like one device can be subscribed to multiple channels and I can push messages through a channel and all subscribers of that channel alone get notifications? 就像一个设备可以订阅多个频道一样,我可以通过一个频道推送消息,并且该频道的所有订阅者都能收到通知吗?

Or do I have another option? 还是我还有其他选择?

GCM does not support channel based notifications. GCM不支持基于频道的通知。

If you use GCM directly, you'll have to implement this functionality yourself: your server will have to manage the mapping between channels and devices (Registration IDs), and push to all the devices subscribed to a channel when you wish to push to that channel. 如果直接使用GCM,则必须自己实现此功能:您的服务器将必须管理频道和设备之间的映射(注册ID),并在希望推送到该频道的所有设备上推送到该频道渠道。

Note 1 : this is already done, APNS and GCM . 注意1APNSGCM已经完成。 Do you have any other features in mind that this two systems do not yet provide? 您是否还记得这两个系统尚未提供的其他功能?

GAE does not support listening sockets, which prevents building any server-to-device persistent connection push system. GAE不支持侦听套接字,这会阻止构建任何服务器到设备的持久连接推送系统。

Note 2 : there is Channels API , but it's web only as it's wrapped in an opaque javascript wrapper and it's protocol is obscured on purpose. 注2 :有Channels API ,但仅在Web上使用,因为它被包裹在不透明的javascript包装器中,并且其协议被故意遮盖了。

Alternative 1 : use an existing external service like PubNub, Pusher, Amazon SNS, etc.. 选择1 :使用现有的外部服务,例如PubNub,Pusher,Amazon SNS等。

Alternative 2 : instead of GAE use Compute Engine , which has no such limitations. 替代方案2 :使用Compute Engine代替GAE,该引擎没有这种限制。 However it does not (yet) have any most of the GAE goodies: it's service APIs (datastore, queues, etc..). 但是,它(至今)还没有任何大多数GAE优点:它是服务API(数据存储,队列等)。

Note 3 : your idea of persistent connections would only work while application on device is "alive", eg in the foreground (at least on iOS, on Android it's possible but would severely impact battery). 注3 :持久连接的想法只有在设备上的应用程序“处于活动状态”时才起作用,例如在前台(至少在iOS,Android上可能,但会严重影响电池电量)。 For universal push-to-device you would need to combine your system with platform-provided async push system (eg APNS and GCM ). 对于通用即按即用设备,您需要将系统与平台提供的异步推送系统(例如APNSGCM )结合起来。

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

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