[英]Not receiving push notification from iOS to android using Quickblox SDK
I have used Quickblox iOS SDK for chat implementation. 我已使用Quickblox iOS SDK进行聊天。 I am facing problem with push notification from iOS device to android device. 我正面临从iOS设备到Android设备的推送通知问题。 By default it should send push to opponent user whenever a message is sent.It does not send push from iOS to Android, however it works fine from iOS to iOS. 默认情况下,无论何时发送消息,它都应向对手用户发送推送消息;它不会将推送消息从iOS发送到Android,但是在iOS到iOS上运行良好。 We have tried following code for sending universal push notification. 我们尝试了以下代码来发送通用推送通知。
NSDictionary *payload = @{
@"message" : @"Test Message",
@"ios_sound" : @"mysound.wav",
@"user_id" : [NSString stringWithFormat:@"%@",obj],
@"thread_id" : @"10"
};
NSData *data = [NSJSONSerialization dataWithJSONObject:payload options:NSJSONWritingPrettyPrinted error:nil];
NSString *messageTosend = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
QBMEvent *event = [QBMEvent event];
event.notificationType = QBMNotificationTypePush;
event.usersIDs = [NSString stringWithFormat:@"%@",obj];//obj is receiver's ID
event.type = QBMEventTypeOneShot;
event.message = messageTosend;
[QBRequest createEvent:event successBlock:^(QBResponse *response, NSArray<QBMEvent *> *events) {
// Successful response with event
} errorBlock:^(QBResponse *response) {
// Handle error
}];
for the above code i am getting status code as 201 but no notification at android device side. 对于上面的代码,我正在获取状态代码为201,但在Android设备端没有通知。
another code i tried is following: 我尝试的另一个代码如下:
[QBRequest sendPushWithText:message toUsers:[NSString stringWithFormat:@"%@",obj] successBlock:^(QBResponse * _Nonnull response, NSArray<QBMEvent *> * _Nullable events) {
} errorBlock:^(QBError * _Nonnull error) {
}];
NOTE: in the above code "obj"is receiver's ID. 注意:在上面的代码中,“ obj”是接收者的ID。
any help will be appreciated. 任何帮助将不胜感激。
thanks in advance. 提前致谢。
I think you are using starter(Free) Plan of Quickblox. 我认为您正在使用Quickblox的入门版(免费)计划。 I am also not getting proper notification in my iOS chat. 我的iOS聊天中也没有收到正确的通知。 When i contacted to quickblox, They called me to upgrade myPlan for Support. 当我联系quickblox时,他们打电话给我升级myPlan for Support。 I upgade myPlan to pro and working fine without any changes in Code. 我将myPlan升级为专业版,并且可以在不更改代码的情况下正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.