1

When testing iMessage applications in the iOS simulator, retrieving the MSConversation.localParticipantIdentifier in the two default conversation threads (Kate Bell, John Appleseed) returns the same NSUUID string because we are still on the "same device".

To implement a turn based app, I am passing the localParticipantIdentifier with the URL data to keep track of the participants' turns.

  1. Person 1 would pass his ID in the message to Person
  2. Person 2 would compare passed ID to her own to determine if she made the last turn.

Is there a way to simulate a unique localParticipantIdentifier between the two test conversations on the iOS 10 simulator? Besides hardcoding the "turn" info for debugging, I cannot think of a way to simulate this real world condition. Thanks.

Note: I do not want to use MSMessage.senderparticipantidentifier because the sender does not necessarily determine who made the turn (ex: user sends a message that updates the app state but is NOT a "turn", 3+ person conversation thread, etc).

ansonl
  • 786
  • 1
  • 13
  • 34
  • I know this question is a few months old, but I'm having the same problem. Would you mind letting me know if you ever did find a way around this? – liam923 Nov 23 '16 at 00:49

1 Answers1

0

Personally I would use remoteParticipantsIdentifier from MSConversation. So the idea is to keep a reference of the latest move with the id of who did the move, and allow the user to play if its id matches with the list of remoteParticipants (and if he is the next on that list).

RomOne
  • 2,065
  • 17
  • 29
  • 1
    The issue is that the generated local and remote identifiers on both sides of the conversation are not the same. The receiver cannot tell which one of the remote participants made a move because the remote ID array is unique to the device and does not match the sender side's local ID. If you meant another technique, could you please explain in more detail? – ansonl Sep 19 '16 at 14:13