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

Ios quickblox推送通知在生产模式下不起作用,ios,push-notification,apple-push-notifications,quickblox,Ios,Push Notification,Apple Push Notifications,Quickblox,我将quickblox添加到我的应用程序中 在开发模式下,推送通知系统运行良好 然而,当我将我的应用程序置于生产模式时,后端系统表示推送已发送,但未收到推送 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ [QBSettings setLogLevel:QBLogLevelDebug]; [QBSetting

我将quickblox添加到我的应用程序中

在开发模式下,推送通知系统运行良好

然而,当我将我的应用程序置于生产模式时,后端系统表示推送已发送,但未收到推送

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{

    [QBSettings setLogLevel:QBLogLevelDebug];
    [QBSettings setApplicationID:kAppID];
    [QBSettings setAuthorizationKey:kAuthorizationKey];
    [QBSettings setAuthorizationSecret:kAuthorizationSecret];
    [QBSettings setAccountKey:@kAccountKey];

    [QBSettings useProductionEnvironmentForPushNotifications:NO];

//switch to production mode 
#ifndef DEBUG
   [QBSettings setLogLevel:QBLogLevelNothing];
   [QBSettings useProductionEnvironmentForPushNotifications:YES];
#endif


    return YES;
}
然后在我的应用程序的某个地方我有了这个代码

-(void)sendPushMessage:(QBChatAbstractMessage *)absMessage toUser:(NSInteger)userId andDelegate:(NSObject<QBActionStatusDelegate>*)delegate{
    NSString *fullName = [self fullName];
    NSString *mesage;
    if(fullName){
    mesage =[NSString stringWithFormat:@"%@ says: %@",fullName, absMessage.text];
    }else {
        mesage = absMessage.text;
    }
    NSMutableDictionary *payload = [NSMutableDictionary dictionary];
    NSMutableDictionary *aps = [NSMutableDictionary dictionary];
    [aps setObject:@"default" forKey:QBMPushMessageSoundKey];
    [aps setObject:mesage forKey:QBMPushMessageAlertKey];

    [aps setObject:[self dictionaryRepresentation] forKey:@"user_info"];
    [payload setObject:aps forKey:QBMPushMessageApsKey];

    NSLog(@"payload:%@",payload);
    QBMPushMessage *message = [[QBMPushMessage alloc] initWithPayload:payload];
    [QBMessages TSendPush:message toUsers:[@(userId) stringValue] delegate:delegate];
}
-(void)sendPushMessage:(qbchatastractmessage*)absMessage-toUser:(NSInteger)userId和delegate:(NSObject*)delegate{
NSString*fullName=[self fullName];
NSString*mesage;
if(全名){
mesage=[NSString stringWithFormat:@“%@表示:%@”,全名,absMessage.text];
}否则{
mesage=absMessage.text;
}
NSMutableDictionary*有效负载=[NSMutableDictionary];
NSMutableDictionary*aps=[NSMutableDictionary];
[aps setObject:@“默认”forKey:QBMPushMessageSoundKey];
[aps setObject:mesage forKey:QBMPushMessageAlertKey];
[aps setObject:[self dictionaryRepresentation]forKey:@“用户信息”];
[payload setObject:aps forKey:QBMPushMessageApsKey];
NSLog(@“有效载荷:%@”,有效载荷);
QBMPushMessage*消息=[[QBMPushMessage alloc]initWithPayload:payload];
[QBMessages-TSendPush:message-toUsers:[@(userId)stringValue]委托:委托];
}
在开发环境中,这段代码工作得非常好。 我检查了几次生产APNS证书,删除了它,重新制作了它,重新安装了它 在生产模式下,没有任何工作

我尝试从管理页面向自己发送生产推送通知

收到这个

这些是它发送到的用户


为什么?

您是否使用临时ipa构建测试生产推送

如果您使用调试模式测试它,它将无法工作

阅读本主题

我已经写了一个如何使这项工作的答案