1

I'm in the final stages of an iMessage extension and have one last lingering issue that I thought was a problem with the simulator but now I have the app working on test devices it's not resolved itself.

When I create a message caption the following code works to change the partipipantIdentifer into their name:

layout.caption = "$\(conversation.localParticipantIdentifier.uuidString)"

However when viewing the message at the recipient's end this code:

self.titleLabel.text = "$\(self.message!.senderParticipantIdentifier.uuidString) sent:"

doesn't display the senders name it just displays their UUID string. What am I missing to convert the sender UUID to their name? Does anyone know if this is this possible or not?

Thanks

SimonBarker
  • 1,384
  • 2
  • 16
  • 31

1 Answers1

2

The "$(participantIdentifier)" syntax only works within MSMessageLayout. When setting the UILabel.text you can only get the uuid.

Dave Weston
  • 6,527
  • 1
  • 29
  • 44
  • Thanks Dave, so I take it there no way to get the name of the participant outside of MSMessageLayout? I guess I can try putting it in the url so the receiving the phone can pull it out from there – SimonBarker Mar 20 '17 at 08:16
  • That's correct. If there were another way to do that, you would lose all the privacy benefits, because you could just read the name out of the UILabel.text property after setting it with the guid. It also won't help for you to send it in the URL because those uuids are device-specific. – Dave Weston Mar 20 '17 at 11:00
  • Thanks, hopefully the api gets expanded so that the $\() syntax works in viewcontrollers as well – SimonBarker Mar 20 '17 at 11:34
  • @DaveWeston do you have any idea what the ObjC syntax for this is? – hotdogsoup.nl Oct 24 '21 at 10:48