How do I retrieve the name of participants in MSConversation?
Unfortunately this is not possible to retrieve any names. The only thing you can do is retrieving the UUID of the local and remote participants. Then you can display there names only into the transcript of the conversation. To do so, when you set a new MSMessage, don't forget the sign $ in the string :
let message = MSMessage(session: theCurrentSession)
let layout = MSMessageTemplateLayout()
layout.caption = "$\(uuidOfTheParticipant) said something"
message.layout = layout
Note :
In objective C you don't need to put "\( )" after the "$", this is used only in swift ;)
This will automatically display the name of the corresponding UUID at the bottom of the MSMessage. Have a look here if you want to learn more about the MSMessage layout : https://developer.apple.com/reference/messages/msmessagetemplatelayout
Also, keep in mind that the UUID of the participant is relative to the conversation itself, it will be consistant into one conversation, but will be different for each participants (the UUID identifying me on my device will be different on others devices). Also if a user uninstall your app and reinstall it, all UUID will be different.
So to answer your question you can not rely on this UUID to identificate any user with the CNContact, they are different ;)
Getting names of participants MSConversation
OK. I found the solution.
I just needed to add a dollar sign before the UUID.
[layout setCaption:[NSString stringWithFormat:@"$%@",self.activeConversation.localParticipantIdentifier.UUIDString]];
Getting names of participants MSConversation
OK. I found the solution.
I just needed to add a dollar sign before the UUID.
[layout setCaption:[NSString stringWithFormat:@"$%@",self.activeConversation.localParticipantIdentifier.UUIDString]];
Is it possible for my app to open the Messages app with my iMessage extension activated, on iOS 10?
An Apple staffer on the Apple Dev forums replied: No, this is not currently possible.
I filed a feature request as RADAR 27079838.
Related Topics
Missing Required Module Firebase - Jenkins Build Error
How to Create Generic Convenience Initializer in Swift
Bad_Access During Recursive Calls in Swift
How to Map Over The Values of Zip2
How to Detect If The User Was Deleted from Firebase Auth
Why Is My Libraries Not Able to Expand on The Cocoapods and Shows as Objective-C Not Swift
How to Change Orientation for Avcapturemoviefileoutput in Swift
How to Specify Japanese Encoding for a UIlabel
Using Associatedtype in a Delegate Protocol for a Generic Type
Swift Cannot Invoke '*' with an Argument List of Type '(Int, Int)'
Loading Image from Assets to Nsimage Keep Getting Error, Expecting Nsimage.Name
Tableview.Cellforrowatindexpath(Indexpath) Return Nil
Scrolltoitem at Indexpath at .Top Hides Cell Under Header When Sectionheaderspintovisiblebounds
Ckasset in Server Record Contains No Fileurl, Cannot Even Check for Nil
Navigation Link in Bar Items Goes Back to Top of Navigationview
Is The for Loop Condition Evaluated Each Loop in Swift