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.

Starting game from a room invitation. Obsolete docs?

LucaMefistoLucaMefisto Posts: 73 Oculus Start Member
Hi all,

I have included the rooms invitation system in my game so I can invite others over.
https://developer.oculus.com/documentation/platform/latest/concepts/dg-rooms/
If the other players are in VR they are receiving the notification and IFF they already had the game opened they are going straight to the unity scene I need them to be. So that is working.

What is not working for me is when the users enter the game from the invitation. The game opens, but then I dont receive any info regarding the invitation so I can move them to the correct scene.
In the docs it says we should use
Oculus.Platform.Rooms.SetRoomInviteNotificationCallback 
"To detect that the user launched from accepting an invite, you can look for an invite-accepted message when launching your app."

In the code, that method is obsolete.
 [Obsolete("Deprecated in favor of SetRoomInviteAcceptedNotificationCallback")]
public static void SetRoomInviteNotificationCallback(Message<string>.Callback callback)
and suggest us to use this one instead
// Be notified when someone you've invited has accepted your invitation. 
public static void SetRoomInviteAcceptedNotificationCallback(Message<string>.Callback callback)


Note the comment! Wich I think it contradicts the documentation, as that should be the callback that the guest receives, not the host!

So basically I am starting my game with `SetRoomInviteAcceptedNotificationCallback` registered. And I know that callback is working because if they accept an invitation _after_ opening the game, the flow is correct.

Maybe I am starting the callback too late? (On Start). Should it be in Awake? Is there a completely different method? (I tried `GetRoomInviteNotifications` but that is completely empty everytime I start the app)

Also: is there a nicer way to test this than having to constantly upload builds to the Store ?

Comments

  • spacefrogspacefrog Posts: 55
    Hiro Protagonist
    edited June 2018
    You have to explicitly gather the outstanding InviteNotifications right after you entered the App ( after platform initialization and entitlement check ). There is Notifications.GetRoomInviteNotifications() for this. I don't remember wether this is documented somewhere or i found out from browsing through the platform source code.
    I make this call  in my app right after my Users.GetLoggedInUser() succeeded. After you checked and processed the outstanding InviteNotifications this way, you can process notifications that happen while the app session is running via the (updated) second callback you mention above
  • LucaMefistoLucaMefisto Posts: 73 Oculus Start Member
    Thanks for the response. That was indeed the docs at least a few weeks ago but seems to have been removed (??). As noted in the post I did try that method but it is coming out empty for me :sweat:  and now I cannot just find the documentation referring to that method again, but instead the instructions "clearly" there say now:

    "To detect that the user launched from accepting an invite, you can look for an invite-accepted message when launching your app. Oculus.Platform.Rooms.SetRoomInviteNotificationCallback "


    So I am a bit puzzled!  By the way does GetRoomInviteNotifications was giving you all the notifications or just the accepted ones?

Sign In or Register to comment.