Search Unity

Question Is there a shared ID for one MCSession?

Discussion in 'AR' started by skoteskote, Mar 2, 2021.

  1. skoteskote

    skoteskote

    Joined:
    Feb 15, 2017
    Posts:
    87
    Hi, I wonder if there is some sort of shared sessionID for one MCSession/collaborative session, that will be identical for all users currently sharing one specific AR experience in the same place? I have unique sessionID's per device, but is there a way for me of knowing which shared session that user is in?

    In my use case, the users need to communicate to a server to get specific content. I need to make sure to only send content to one user per shared MCSession, so I need some sort of identifier. Otherwise, I risk sending content to several users in one shared session.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Hey there! So, MCSession is not part of the AR Foundation API. You'll want to look up documentation of Apple's MCSession framework.
     
    skoteskote likes this.
  3. skoteskote

    skoteskote

    Joined:
    Feb 15, 2017
    Posts:
    87
    Thanks for the response! I dug into this and no there doesn't seem to be any shared ID for an ongoing MCSession. My solution to this, in case anyone would run into a similar issue, is to store a temporary list with all users sessionID's, and check the sessionID's each user finds through ARParticipantManager against this list to determine which shared AR session they're in.