Quickblox iOS 推送通知不工作

Quickblox iOS Push notifications not working

在 Quickblox iOS 中,当我收到聊天消息或通过代码发送推送通知时,通知不起作用(尽管它适用于 Parse)。它工作的唯一方法是当我在管理面板上发送推送通知时选择 "Testing"-Environment 当应用程序打开或处于后台模式时(完全关闭时不工作)。

这是我用于通过 quickblox 发送聊天消息的代码:

-(IBAction)sendMessage:(id)sender{
    NSString *messageText = self.messageTextField.text;
    if(messageText.length == 0){
        return;
    }

    QBChatMessage *message = [QBChatMessage message];
    message.text = messageText;
    message.markable = YES;
    message.dialogID = self.dialog.ID;
    NSString *senderLogin = [LocalStorageController shared].qbUser.login;
    NSMutableDictionary *senderLoginDictionary = [[NSMutableDictionary alloc]init];
    [senderLoginDictionary setObject:senderLogin forKey:@"senderName"];
    [message setCustomParameters:senderLoginDictionary];

    [[QMServicesManager instance].chatService sendMessage:message toDialog:self.dialog save:YES completion:nil];

    // clean text field
    [self.messageTextField setText:nil];
}

我已经向 quickblox 提交了工单,但没有收到任何答复。

在 Quickblox 中有两种管理推送通知的方法:

  1. 自动聊天提醒(推送通知)。服务器将向与特定聊天对话相对应的所有离线用户发送推送通知。这是有关如何设置它的文档:http://quickblox.com/developers/Chat#Alerts

  2. 手动推送通知:您可以在每次向特定用户发送消息时发送推送通知。但请记住,所有推送通知都是基于平台的,您需要发送通用推送。有指南:http://quickblox.com/developers/SimpleSample-messages_users-ios#Send_Push_Notifications_from_application_.28via_API.29

要设置 APNS 证书,请遵循以下指南:http://quickblox.com/developers/SimpleSample-messages_users-ios