我能够创建组对话框,因为我找到了这段代码:
chatDialog = [[QBChatDialog alloc] initWithDialogID:@"dialogueid" type:QBChatDialogTypeGroup];
chatDialog.name = @" Bob, Sam, Garry";
chatDialog.occupantIDs = @[@(1)];
[QBRequest createDialog:chatDialog successBlock:^(QBResponse *response, QBChatDialog *createdDialog) {
} errorBlock:^(QBResponse *response) {
}];
但是当我尝试将类型更改为QBChatDialogTypePrivate
时。
对话框没有创建,你可以告诉我什么是对话框ID以及在哪里找到它?
答案 0 :(得分:5)
只需初始化ID为nil的QBChatDialog,服务器将为您设置,并且QBRequest返回的createdDialog将具有正确的dialogID。
QBChatDialog *chatDialog = [[QBChatDialog alloc] initWithDialogID:nil type:QBChatDialogTypePrivate];
chatDialog.occupantIDs = @[@(opponentID)];
[QBRequest createDialog:chatDialog successBlock:^(QBResponse *response, QBChatDialog *createdDialog) {
NSLog(@"Created dialog: %@", createdDialog);
} errorBlock:^(QBResponse *response) {
NSLog(@"Failed to create dialog with error: %@", response.error);
}];