Ios 如何识别iMessage扩展中的消息来自发送方还是接收方?

Ios 如何识别iMessage扩展中的消息来自发送方还是接收方?,ios,ios10,ios-extensions,imessage-extension,Ios,Ios10,Ios Extensions,Imessage Extension,我正在开发iMessage扩展,在该扩展中,当用户点击接收者的消息时,我必须打开详细视图控制器。但是目前还没有办法区分被点击的消息是来自接收者还是发送者(用户自己的消息)。MSMessage包含了发送者的参与者标识 您可以将其与MSConversationslocalparticipantinidentifier和remoteparticipanidentifiers进行比较 您可以在中找到更详细的说明。中还有标识符的替代项。您需要实现一些逻辑关系: 我们可以通过以下步骤进行: i) All t

我正在开发iMessage扩展,在该扩展中,当用户点击接收者的消息时,我必须打开详细视图控制器。但是目前还没有办法区分被点击的消息是来自接收者还是发送者(用户自己的消息)。

MSMessage包含了发送者的参与者标识

您可以将其与
MSConversation
s
localparticipantinidentifier
remoteparticipanidentifiers
进行比较


您可以在中找到更详细的说明。

中还有标识符的替代项。您需要实现一些逻辑关系:

我们可以通过以下步骤进行:

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.
逻辑从服务器端开始:-

所以服务器在点击iMessage后会收到唯一的ID。那么桌子呢 在创建要比较的消息帮助时,我们已经存储了这些数据 在表中存储唯一id,点击后接收唯一id 我的消息。如果两者相同,那么我们可以清楚地说它是发送者 它本身就是接收器,点击iMessage

如果主应用程序由UNIQUE-ID组成,那么我们必须首先 导航到主应用程序,我们可以通过 在中启用组功能并由组共享UNIQUE-ID 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 .