【发布时间】:2018-04-16 14:22:39
【问题描述】:
我使用 PubNub 服务在我的应用程序中聊天,现在它可以正常工作了,用于:订阅频道、将消息发布到频道、接收消息... 但是,当一个用户将消息发送到用户订阅的频道时,我不想收到推送通知消息。 我在 PubNub 管理员中配置了 APNS 证书
我测试了我的 PEM 文件的 Push 服务关注 link
推送消息来了。 我将我的设备令牌添加到我订阅的频道中
[self addPushNotificationsOnChannels:@[@"channel1", @"channel2"] withDevicePushToken:self.deviceToken andCompletion:^(PNAcknowledgmentStatus * _Nonnull status) {
if (!status.error) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Token Chat" message:status.errorData.information delegate:@"Sent token OK" cancelButtonTitle:@"Close" otherButtonTitles:nil];
[alert show];
}
else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Token error" message:status.errorData.information delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil];
[alert show];
}
}];
然后,我再次检查了已添加 deviceToken 的列表频道,列表频道匹配。 但是当我尝试从聊天(从用户到用户,从用户到频道)发送(发布)消息时,我的设备没有收到任何推送消息。
我可能错过了一些步骤或什么?请指教!
【问题讨论】:
-
您是否尝试过使用 pndebug 通道查看是否有任何错误消息? Please review this mobile push troubleshooting section 如果您从 -pndebug 频道收到任何有用的消息,请告诉我们。
-
@CraigConover 是的,我在 -pndebug 上测试过,消息来了,但是当我在频道上与用户聊天时,消息没有来
标签: apple-push-notifications pubnub apn