I am trying to create a ConversationViewController with prespecified participants. When I create the conversation and push the controller, the participants address bar doesn’t show any names. Also, if there is an existing conversation started, the error throws.
How can I push the ConversationViewController with the specified participants?
Here is the code and debugger output to help you understand where I am:
ConversationViewController *controller = [ConversationViewController conversationViewControllerWithLayerClient:SingletonCenter.layerClient];
NSError *error;
LYRConversation *conversation = [SingletonCenter.layerClient newConversationWithParticipants:[NSSet setWithArray:@[User.objectId,self.requestForView.serviceProvider.objectId]] options:nil error:&error];
NSLog(@"conversation is: %@\nerror is: %@",conversation, [error localizedDescription]);
controller.conversation = conversation;
controller.displaysAddressBar = YES;
[self.navigationController pushViewController:controller animated:YES];
conversation is: "LYRConversation:0x7faa724a7730 identifier=layer:///conversations/c8eeaf04-085b-4c11-a985-a23aeeeb5f3e databaseIdentifier=LYRDatabaseIdentifierNotDefined version=LYRVersionNotDefined isDeleted=NO streamUUID=(null) participants={( Y8Ak1U1Mbj, AdW9c2FYeN )} distinctByParticipants=YES"
conversation is: (null) error is: A conversation with a distinct participant list already exists for participants {( Y8Ak1U1Mbj, AdW9c2FYeN )}