Send Friend Requests from Apps - Mobile

Users can initiate friend requests to other users encountered in your app by launching the process from within the app. After the friend request has been sent via a deeplinked modal, the viewer is returned to your app. Users may find this process more convenient than using the Oculus phone app or returning to Oculus Home to send friend requests since it’s less disruptive to the app experience they are currently focused on.

For example, in a multiplayer game, a user might encounter another player that they liked. If this feature is implemented, they can initiate the friending process from within the game, send the friend request from a deeplinked modal, and be returned to their game once the request has been sent.

Note: This feature is only available for mobile apps at this time.

Send a Friend Request from an App

The following methods are available to call from within your client app. Details about the functions can be found in the Platform SDK Reference Content.

  • Send a Friend Request from an App:

Native - ovr_User_LaunchFriendRequestFlow()

Unity - Platform.Users.LaunchFriendRequestFlow()

This method deeplinks the viewer into a modal dialog targeting the specified user to receive a friend request. From the modal, the viewer can select Send to send a friend request and return to their app. Selecting Cancel returns the viewer to their app without sending a friend request.

After calling this method, you can use ovr_LaunchFriendRequestFlowResult_GetDidSendRequest and ovr_LaunchFriendRequestFlowResult_GetDidCancel to get the results of the viewer’s actions from the deeplink.

  • Check If Viewer Sent a Friend Request:

Native - ovr_LaunchFriendRequestFlowResult_GetDidSendRequest

Unity - Platform.LaunchFriendRequestFlowResult.GetDidSendRequest

Checks if the viewer sent a friend request from the deeplinked modal.

  • Check If Viewer Canceled Rather than Sending a Friend Request:

Native - ovr_LaunchFriendRequestFlowResult_GetDidCancel

Unity - Platform.LaunchFriendRequestFlowResult.GetDidCancel

Checks if the viewer canceled or selected Back from the deeplinked modal.

Other Outcomes

In some edge cases, the modal dialog that appears when ovr_User_LaunchFriendRequestFlow is called may be different. The table below details such situations and what the user will see.

SituationDescriptionResult Feedback
Viewer tries to send a friend request to themselfThe viewer will receive a message indicating that this is not supported. Selecting Back returns the viewer to their app.ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true
Viewer tries to send a friend request to someone that is already a friendThe viewer will receive a message informing them that they are already friends. Selecting Back returns the viewer to their app.ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true
Viewer tries to send a friend request to someone they already sent a pending friend requestThe viewer will receive a message informing them that they have already sent a friend request to that user. Selecting Back returns the viewer to their app.ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true
Viewer tries to send a friend request to someone they already have a pending request fromThe viewer will receive a message informing them of the pending friend request. From there, they can select Accept to accept the received friend request and return to their app, or they can select Cancel to return to their app without accepting or denying the friend request.On Accept:ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: false On Cancel:ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true
Viewer tries to send a friend request to someone they blocked previouslyThe viewer will receive a message informing them of the situation and asking whether they would like to unblock the target user and send a friend request. If the viewer selects Unblock and Send, the target user is unblocked, a friend request is sent, and the user is returned to their app. Otherwise, selecting Back will return the viewer to their app.On Unblock and Send:ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: true ovr_LaunchFriendRequestFlowResult_GetDidCancel: false On Back:ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true
Viewer tries to send a friend request to someone that has blocked them previouslyThe user will receive the following message: We cant show you this person right now. Please try again later.ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true
The friend request cannot be sent for some other reasonThe user will receive the following message: We cant show you this person right now. Please try again later.ovr_LaunchFriendRequestFlowResult_GetDidSendRequest: false ovr_LaunchFriendRequestFlowResult_GetDidCancel: true