Search code examples
iosswiftquickblox

Can we create multiple ChatDialogs for same opponent? (In 1-1 Quickblox chat)


Below is my code

   var qbChatDialog = QBChatDialog()
   qbChatDialog.occupantIDs = [strOpponentQuickbloxID]
   qbChatDialog.type = QBChatDialogType.Private
   qbChatDialog.data = ["class_name": "HQCustomClass", "game_id": strGameID]
   //qbChatDialog.name = "\(strGameID)Holy" //Can we use this field in 1-1 chat?

   //Create Dialog
   QBRequest.createDialog(qbChatDialog,
            successBlock: { (qbResponse, newDialog) -> Void in
                println("***** New Dialog \(newDialog)*******\n\n\n\n")
            },
            errorBlock: { (qbErrorResponse) -> Void in
                println("***** Dialog Error \(qbErrorResponse)*******\n\n\n\n")
   })

Always getting same Quickblox ChatDialog.


Solution

  • It's impossible to create many 1-1 dialogs with the same opponent

    Use type QBChatDialogType.Group for this.