On this Page
The Oculus platform provides the Sharing feature, which enables users to share their VR experience with photos, videos, and livestreaming to their Facebook network. In addition, users can cast content from their Oculus device to another device on the same network.
Note: The Sharing feature is only available for Android apps at this time.
Users who wish to share with their Facebook network first need to link their Oculus account to their Facebook account. If you want users to share content from your apps, notify them that Sharing is available to them if they link their accounts using the Settings -> Linked Account -> Link to Facebook section of the Oculus 2D app.
It is important to note that the Sharing feature is enabled for your apps by default. To disable Casting, Livestreaming or Video Recording for your apps, navigate to Sharing in the Developer Center, select an app, move the slider to disable, and then choose Save.
All sharing is initiated by the user through the Oculus Platform. However, there are a couple of SDK methods you should call at certain points in your game to accommodate livestreaming. For example, you should pause a livestream if the user is entering a password or credit card information. Then, once the user has finished that activity, you can resume the stream.
The following SDK methods can be called from the client app.
Native - ovr_Livestreaming_GetStatus()
Unity - Platform.Livestreaming.GetStatus()
Check the status of the livestream.
Native - ovr_Livestreaming_PauseStream()
Unity - Platform.Livestreaming.PauseStream()
Pause the livestream.
Native - ovr_Livestreaming_ResumeStream()
Unity - Platform.Livestreaming.ResumeStream()
Resume the paused livestream.
If you’re using Unreal, please use the native C API using the information found in Unreal Development Getting Started.
Livestreaming a user’s experience may have an impact on the performance of your app. We recommend testing how your app performs when a user is livestreaming and adjusting features and performance as appropriate.
To test livestreaming in your app:
ovr_Livestreaming_GetStatus()
check to your app to determine when a user has enabled livestreaming.ovr_Livestreaming_GetStatus()
.Photo Sharing allows users to post screen captures they take in VR to their Facebook network. If a user has not previously associated their Facebook and Oculus accounts, they will be prompted to do so the first time they are shown the sharing modal.
The following SDK method allows users to share photos from inside your app.
ovr_Media_ShareToFacebook
Platform.Media.ShareToFacebook
When calling ovr_Media_ShareToFacebook
, you’ll provide a path to an image that will be shared with Oculus Home. You’ll also be able to pass a text suggestion that will be populated in the post body of the modal presented to the user. They may edit the text before they post to their Facebook feed.
Photo Sharing supports PNG, GIF, and JPEG image formats.
If you’re using Unreal, please use the native C API using the information found in Unreal Development Getting Started.
Photos that users want to share should be saved internally in your app. When a user initiates the request to share the photo, you’ll provide access to Oculus by sending a path to a file saved in the internal storage directory for your application.
If you use external storage and the Oculus app does not have permission to access the file, the request will fail.
Use the following method to launch the photo sharing modal.
OVRP_PUBLIC_FUNCTION(ovrRequest)ovr_Media_ShareToFacebook(const char *postTextSuggestion, const char *filePath, ovrMediaContentType contentType);
In this example:
postTextSuggestion
is a default, pre-populated text for the post bodyfilePath
is the path to a file in your app’s internal storage directory that should be shared with Oculus Home.ovrMediaContentType
is the media type of the file identified by the filePath. At this time only ovrMediaContentType_Photo
is supported.After calling ovr_Media_ShareToFacebook
, the user will be shown an Oculus modal displaying their chosen photo. Here, the user can add their own message for the body of the post and select their desired privacy settings.
The user can then select Share to Facebook to complete the action, close the modal, and return to your app. A status of SHARED
will be returned indicating if the user successfully shared the photo, or CANCELLED
if the user canceled the action. An error will be returned if something went wrong.