Search code examples
iosnotificationschatquickblox

Quickblox iOS notification when a new dialog is added


Is there a iOS notification that we get in ServiceManager (QMServicesManager), chatService to notify the app that a new Dialog is added for the user. Basically a brand new chat request


Solution

  • You could use QuickBlox's System notifications to send the message to the recipient after creating a dialog

    let message: QBChatMessage = QBChatMessage()
        let params = NSMutableDictionary()
        params["event_type"] = "NewDialogCreated"
        params["dialogId"] = <dialogId or the information you need to pass>
        message.customParameters = params
        message.recipientID = UInt(recipientId)!
    
        QBChat.instance.sendSystemMessage(message) { (Error) in
    
        }
    

    and recipient could receive this message in QBChatdelegate

    #pragma mark QBChatDelegate
    
    func chatDidReceiveSystemMessage(message: QBChatMessage!) {
    
    }