Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

[REOPENED] Oculus Platform - Invite user to room

biowolvesbiowolves Posts: 20
Brain Burst
edited April 2016 in Unity Development
Hi,
I am trying to implement the oculus platform room feature and am wanting to know what happens after calling

Oculus.Platform.Rooms.InviteUser("the rooms ID","the invite token for that user");

The callback for this is being received by the sender but am not sure what I need to do to get the information on the invited users end.
Can anyone please tell me what I need to do to get the invite on the other end?

Comments

  • brian_jewbrian_jew Posts: 62 Oculus Staff

    Yes, you can add a callback to listen for that notification:

      Oculus.Platform.Callback.SetNotificationCallback<Models.Room>(
        Message.MessageType.Notification_Room_InviteAccepted,
        {Message<Models.Room> callback to respond to invite here}
      );

    We will add wrap this under Rooms as a convenience function in the future: 

    Oculus.Platform.Rooms.SetRoomInviteAcceptedNotificationCallback(<callback here>);

  • biowolvesbiowolves Posts: 20
    Brain Burst
    Thanks Brian, didn't know of any of them calls so you have helped a lot.
    Just to check does InviteAccepted instantly get called so I have to implement an accept/refuse input or does the oculus platform have a pop-up for the user to accept the invite first?
  • biowolvesbiowolves Posts: 20
    Brain Burst
    Never mind just didn't notice were the notification was on the other account.
    Again thank you Brian. I will probably be back on the forums with more questions later :)
  • brian_jewbrian_jew Posts: 62 Oculus Staff
    No problem!  One more thing is that I made a small mistake in my example code.  

    It's coming back as a string with the room id rather than the full room model itself.  So rather than calling the generic with <Models.Room>, do <string> instead and get the room id
  • biowolvesbiowolves Posts: 20
    Brain Burst
    edited April 2016
    Ok, this has given me some more questions.
    If it is a string instead of a Room does it mean that I don't need to check that the applications ID for the room and the application ID running match?
    When the other user receives the invite and accepts it does the game start up with anything different or does the "Notification_Room_InviteAccepted" callback get called when the invited users game Initialize the oculus platform?
    How does the user receive the invite if they are already in game?
  • brian_jewbrian_jew Posts: 62 Oculus Staff
    Sorry, this question was lost among my notifications:

    >If it is a string instead of a Room does it mean that I don't need to check that the applications ID for the room and the application ID running match?

    Correct

    >When the other user receives the invite and accepts it does the game start up with anything different or does the "Notification_Room_InviteAccepted" callback get called when the invited users game Initialize the oculus platform?

    The notification callback will get called the moment a callback is attached in that case.  If the game starts up and doesn't attach a callback, the Oculus Platform SDK will hold onto the notification until a callback is attached, then immediately call the callback.

    >How does the user receive the invite if they are already in game?
    I'm not sure about this one.
Sign In or Register to comment.