iMessage identifiers converted to phone number instead of name
Asked Answered
T

0

2

I’m developing an Messages extension. When it comes time to send a message, I want it to show up as something like: “Jeff sent a message.”

However, the MSConversation APIs only give us identifiers. When you use these identifiers in the MSMessage layout, it’s supposed to convert them to a name. When I attempt to do this, I see that it does indeed convert the identifier, but it converts it to the phone number of the participant rather than their name.

In other words, the following:

layout.caption = "$\(uuidOfTheParticipant) sent a message"

Shows up as “+15555551234 sent a message”. I’d like it to show a name instead of the phone number.

I searched the documentation to verify that this should be the behavior. I found out it was documented in the WWDC 2016 session 224 video. This was called “iMessage Apps and Stickers Part 2”. The video has been taken down since, so I had to rely on this transcript, where it states:

similarly, you can use these identifiers in the text passed to the Messages sumamaryText. When Messages displays the UI for the bubbles with this type of formatting in their text, it will replace the identifiers with the contact name of the person that their identifier maps to.

In both cases, it sounds like the name of the participant should be showing up rather than their phone number.

I tried updating my contact’s number to look exactly like the one that’s being output (I.e. “+1” in front), but it’s still showing the phone number rather than the name.

Does the API no longer show names, or am I doing something wrong?

Tier answered 26/2, 2022 at 15:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.