Quickblox通用推送通知不起作用。

莫妮卡

我正在为我的应用程序使用quickblox。此应用程序均适用于android iOS。我正在处理推送通知。为此,我使用以下代码:

// Send push to users with ids 292,300,1295
    QBMEvent *event = [QBMEvent event];
    event.notificationType = QBMNotificationTypePush;
    event.usersIDs = [NSString stringWithFormat:@"%ld", (long)recepID];
    event.type = QBMEventTypeOneShot;

    // standart parameters
    // read more about parameters formation http://quickblox.com/developers/Messages#Use_custom_parameters
    //
    NSMutableDictionary  *dictPush = [NSMutableDictionary  dictionary];
    [dictPush setObject:@"Message received from Bob" forKey:@"message"];
    [dictPush setObject:@"5" forKey:@"ios_badge"];
    [dictPush setObject:@"mysound.wav" forKey:@"ios_sound"];

    // custom params
    [dictPush setObject:@"234" forKey:@"user_id"];
    [dictPush setObject:@"144" forKey:@"thread_id"];

    NSError *error = nil;
    NSData *sendData = [NSJSONSerialization dataWithJSONObject:dictPush options:NSJSONWritingPrettyPrinted error:&error];
    NSString *jsonString = [[NSString alloc] initWithData:sendData encoding:NSUTF8StringEncoding];
    //
    event.message = jsonString;

    [QBRequest createEvent:event successBlock:^(QBResponse * _Nonnull response, NSArray<QBMEvent *> * _Nullable events)
    {
        // Successful response with event
        NSLog(@"Create event successfully to: %ld", (long)recepID);
    }
                errorBlock:^(QBResponse * _Nonnull response)
    {
        // Handle error
        NSLog(@"Create event error to: %@", response.error.description);
    }];

此创建事件失败,并且显示此错误:

Create event error to: 
   Error reasons:{
    errors =     (
        "No one can receive the message"
    );
}

所有设备都在“订阅”部分中。仍然会给出错误。我从这个quickblox文档中复制了此代码请帮我。

莫妮卡

通过在我的代码中添加以下行来解决此问题:

event.isDevelopmentEnvironment = ![QBApplication sharedApplication].productionEnvironmentForPushesEnabled;

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类常见问题

iOS 7中的静默推送通知不起作用

来自分类Dev

解析推送通知-Swift安装不起作用

来自分类Dev

Braintree推送通知不起作用

来自分类Dev

quickblox推送通知在生产模式下不起作用

来自分类Dev

MobileFirst推送通知-轮询不起作用

来自分类Dev

Quickblox“离线用户的自动推送通知”不起作用

来自分类Dev

CloudKit推送通知订阅不起作用

来自分类Dev

iOS推送通知本地化不起作用

来自分类Dev

推送通知不起作用-Android

来自分类Dev

生产中的推送通知不起作用

来自分类Dev

推送通知在iOS 9.2.1中不起作用

来自分类Dev

推送通知在杂货店中不起作用

来自分类Dev

Google日历的推送通知不起作用

来自分类Dev

React Native Ios推送通知不起作用

来自分类Dev

推送通知不起作用Xcode 11.3.1

来自分类Dev

didRegisterForRemoteNotificationsWithDeviceToken没有被触发-推送通知不起作用

来自分类Dev

更改包ID后,推送通知不起作用

来自分类Dev

QuickBlox,推送通知不起作用

来自分类Dev

Braintree推送通知不起作用

来自分类Dev

失败后,Azure推送通知中心不起作用

来自分类Dev

Quickblox“离线用户的自动推送通知”不起作用

来自分类Dev

iOS 8推送通知在实际设备上不起作用

来自分类Dev

将通知从iOS推送到Android不起作用

来自分类Dev

推送通知在Apple Beta测试(TestFlight)中不起作用

来自分类Dev

Android Parse推送通知不起作用-“设备过时”

来自分类Dev

GCM推送通知在Android App中不起作用

来自分类Dev

IBM Marketing Cloud推送通知Cordova插件不起作用

来自分类Dev

推送通知不起作用/ Heroku-mLab

来自分类Dev

使用 PHP 的 iOS MDM 推送通知,不起作用

Related 相关文章

热门标签

归档