I am developing iMessage Extension in which I have to open detail view controller when user tap on receiver's Message. But at the moment not getting way for how to differentiate that tapped message is from receiver's or sender's(User's Own message).
2 Answers
The MSMessage
holds the senderParticipantIdentifier
.
You can than compare it with the MSConversation
s localParticipantIdentifier
and remoteParticipantIdentifiers
.
You can find a slightly more detailed description in this WWDC 21016 video.

- 19,212
- 9
- 65
- 112
There is also alternative of Identifier. You need to implement some logical relation:-
We can do by following steps :
i) All the user must have UNIQUE-ID in your application like Passport-No,Bank Account Number.
ii)When send is tap on iMessage in compact mode then Unique-ID must be send to Server along with data like price,game move or so on . Server Fill the entry of Unique ID along with data in there Table.
iii)When User(sender or receiver) Taps the iMessage:- Unique-id on iMessage must be send to server along with the URL which we parse from the iMessage.
Logic starts in server side:-
So Server receive Unique-ID after tap of iMessage . So the Table which we have stored data before when creating the message help to compare the stored Unique-id in table and receive Unique-ID after tap of iMessage . If both are same then we can clearly say that it is sender itself else it is Receiver have tap on iMessage.
iv)On the response of above third steps :- Server will send the status 0 or 1 : If the server send the status 0 then it means it is sender itself else it is receiver have tap the iMessage .
If the main application consist of UNIQUE-ID then we have to first navigate to main application and we can easily share the UNIQUE-ID by enabling the group capabilities and sharing UNIQUE-ID by the group in the iMessage extension for first time and it will persist till the app exist.

- 7,128
- 4
- 29
- 40