简体   繁体   English

Pubnub:推送通知问题

[英]Pubnub: Issue with Push Notification

I am using Pubnub for a chat based Application. 我正在将Pubnub用于基于聊天的应用程序。

Consider a scenario where Alice initiates a chat with Bob . 考虑一个爱丽丝发起与鲍勃聊天的场景。 Flow at Alice's end for initiating a new chat: 在Alice的端开始新聊天的流程:

  • Subscribe newChannel 订阅newChannel
  • Add to your own channel group 添加到自己的频道组
  • Create Bob's channel group 创建鲍勃的频道组
  • Add newChannel to Bob's channel group 将newChannel添加到Bob的频道组中
  • Unsubscribe Bob's channel group 退订Bob的频道组

Since Bob is now subscribed to this newChannel he receives the messages from Alice. 由于Bob现在已订阅此newChannel,因此他从Alice接收消息。 But Bob's device is not registered to receive push notifications for the channel. 但是Bob的设备未注册为接收该频道的推送通知。

If the app in Bob's phone is not running Bob does not get a push notification for these messages and the messages is missed. 如果Bob手机中的应用未运行,则Bob不会收到有关这些消息的推送通知,并且消息会丢失。

Need a work around to notify Bob that he has received a message from some new user. 需要变通通知鲍勃,他已经收到一些新用户的消息。

App is running on both platforms iOS & Android and the chat is between a customer and service-provider. 该应用程序可同时在iOS和Android两种平台上运行,并且聊天是在客户与服务提供商之间进行的。 Important for the service-provider to be notified when receives a message from a new customer. 当收到新客户的消息时通知服务提供商很重要。

Flow working fine when receives a message from a existing thread since in this case device is registered to receive push notifications for this particular channel. 当从现有线程接收消息时,流程工作正常,因为在这种情况下,设备已注册为接收此特定通道的推送通知。

Registering for push notifications is separate from subscribing to channels or channel groups. 注册推送通知与订阅频道或频道组是分开的。 You just need to register Bob to each channel (not channel group) for push notifications and he will always receive the push notification. 您只需要向每个频道(不是频道组)注册Bob即可获得推送通知,他将始终收到该推送通知。

Please see the Mobile Push Troubleshooting Guide , and if you still have issues/questions, report all important data you gathered from that troubleshooting to PubNub Support. 请参阅《 移动推送故障排除指南》 ,如果仍然有问题,请将从故障排除中收集的所有重要数据报告给PubNub支持。

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

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