Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
10 years ago

[REOPENED] Oculus Platform - Invite user to room

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?

6 Replies

Replies have been turned off for this discussion
  • brian_jew's avatar
    brian_jew
    Expert Protege

    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>);

  • Anonymous's avatar
    Anonymous
    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?
  • Anonymous's avatar
    Anonymous
    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_jew's avatar
    brian_jew
    Expert Protege
    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
  • Anonymous's avatar
    Anonymous
    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_jew's avatar
    brian_jew
    Expert Protege
    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.