我正在使用quickblox开发应用程序的聊天模块。它工作正常。但是我没有收到任何聊天消息的推送通知,而应用程序是terminated.Can,有人在这方面帮助我吗?
发布于 2016-10-03 21:20:23
由于您希望收到推流通知,因此您需要验证以下步骤。
第1步:在quickblox Portal中设置所有证书和密码以发送通知。
< application.
步骤2:设置quickblox门户所需的所有信息后执行。您需要在subscribe应用程序中添加代码,才能获得登录用户设备的通知。
NSString *deviceIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
QBMSubscription *subscription = [QBMSubscription subscription];
subscription.notificationChannel = QBMNotificationChannelAPNS;
subscription.deviceUDID = deviceIdentifier;
subscription.deviceToken = <Replace-Device-Token-Here>;
[QBRequest createSubscription:subscription successBlock:^(QBResponse *response, NSArray *objects) {
// Success.
} errorBlock:^(QBResponse *response) {
// Error.
}];步骤3:一旦用户执行注销操作,则需要从quickblox服务器取消订阅推送通知,以停止接收到已注册设备的通知。
NSString *deviceUdid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
[QBRequest unregisterSubscriptionForUniqueDeviceIdentifier:deviceUdid successBlock:^(QBResponse *response) {
// Success.
} errorBlock:^(QBError *error) {
// Error.
}];如果你对此有任何意见,请告诉我。
谢谢。
https://stackoverflow.com/questions/39753685
复制相似问题