Event-based notifications are delivered to users based on events defined in your code.
As a reminder, event-based notifications are started and submitted for review from the user notifications dashboard, but you will also need to implement the event that will trigger the notification in your code.
Follow the “Next Steps” instructions to implement the correct code.
In your app’s server side code, make a POST request to the Meta Quest Graph API with the endpoint https://graph.oculus.com.
In your app’s server side code, include 3 things:
Your request ID: Copy and paste the notification’s request ID, which you’ll see immediately after you submit your notification. You can also find it by going to the three dot menu next to the notification on your dashboard and clicking “View Request ID”.
A list of recipient IDs: Provide the list of users who will receive this notification.
One of the following:
For notifications with the “Social” category, a user token: You can generate a user token in the Development > API tab of the Meta Quest Developer Dashboard after you select an app.
For all other notification categories, app credentials: Copy and paste the app credentials from the Development > API tab of the Meta Quest Developer Dashboard after you select an app.
The API uses the Graph API, which has additional documentation on how to generate an access token and other important information.
Code Sample
Here’s an example of what your code would look like with the request ID, a list of recipient IDs, and your access token.
The recipient IDs are the app-scoped user IDs for the recipients, the request ID is the ID for your approved trigger based notification request, and the access token is the app credentials.
Upon success, this will return: