### Initialize and Use Meta Platform SDK in Godot Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/manual/platform_sdk/getting_started This GDScript snippet demonstrates how to initialize the Meta Platform SDK, check user entitlement, and retrieve a list of the user's friends who also own the application. It includes error handling for each asynchronous operation. Ensure you have completed the necessary setup steps and obtained your App ID. ```gdscript func setup_meta_platform_sdk(): var result: MetaPlatformSDK_Message # Replace "1234" with your App ID. result = await MetaPlatformSDK.initialize_platform_async("1234").completed if result.is_error(): print("Unable to initialize the platform SDK: ", result.error) return # Check that the user owns this app and is entitled to use it. result = await MetaPlatformSDK.entitlement_get_is_viewer_entitled_async().completed if result.is_error(): print("The user isn't entitled: ", result.error) return # Get the list of the user's friends who also own this app. # NOTE: This will only work if you requested access to "Friends" on your DUC (see earlier instructions). result = await MetaPlatformSDK.user_get_logged_in_user_friends_async().completed if result.is_error(): print("Unable to get friends: ", result.error) return print("My friends:") for user in result.data: print("- ", user) ``` -------------------------------- ### Get Launch Details Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves information about how the current application was started. This function returns a MetaPlatformSDK_LaunchDetails object containing relevant startup data. ```gdscript var launch_details = MetaPlatformSDK.application_lifecycle_get_launch_details() print("Launch details: ", launch_details) ``` -------------------------------- ### GET /application/lifecycle/launch_details Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves information about how the current application was started. This is useful for understanding the launch context, such as deeplink parameters. ```APIDOC ## GET /application/lifecycle/launch_details ### Description Retrieves information about how the current application was started. This is useful for understanding the launch context, such as deeplink parameters. ### Method GET ### Endpoint /application/lifecycle/launch_details ### Parameters None ### Response #### Success Response (200) - **MetaPlatformSDK_LaunchDetails** - An object containing details about the application's launch. #### Response Example ```json { "launch_source": "deeplink", "deeplink_context": { "path": "/profile/123", "params": { "utm_source": "social" } } } ``` ``` -------------------------------- ### Asset File Get List Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves a list of asset files, including their names, IDs, and installation status. ```APIDOC ## GET /asset/file/list ### Description Gets an array of objects with asset file names and their associated IDs, and whether it's currently installed. ### Method GET ### Endpoint /asset/file/list ### Parameters #### Query Parameters None ### Request Example ```json null ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_AssetDetailsArray) - An array of asset details objects. - **is_error** (bool) - Indicates if the request resulted in an error. #### Response Example ```json { "data": [ { "asset_id": 12345, "file_name": "example_asset.file", "is_installed": true }, { "asset_id": 67890, "file_name": "another_asset.file", "is_installed": false } ], "is_error": false } ``` ``` -------------------------------- ### application_install_app_update_and_relaunch_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Installs a previously downloaded app update and relaunches the application. Returns a MetaPlatformSDK_Request that emits a MetaPlatformSDK_Message on completion. ```APIDOC ## POST /application/update/install/relaunch ### Description Installs a downloaded application update and then relaunches the application. ### Method POST ### Endpoint /application/update/install/relaunch ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **deeplink_options** (MetaPlatformSDK_ApplicationOptions) - Optional - Additional configuration for the relaunch, such as deep linking parameters. ### Request Example ```json { "deeplink_options": { "deep_link_url": "myapp://open?data=123" } } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_AppDownloadResult) - The result of the app update installation. - **message** (MetaPlatformSDK_Message) - A message object containing the result of the operation. #### Response Example ```json { "data": { "success": true }, "message": { "error": false, "data": "MetaPlatformSDK_AppDownloadResult" } } ``` ``` -------------------------------- ### Get Livestreaming Start Result (GDScript) Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Fetches the result of attempting to start a livestream. This constant method requires no arguments and returns a MetaPlatformSDK_LivestreamingStartResult. ```gdscript var livestream_start_result = MetaPlatformSDK.get_livestreaming_start_result() ``` -------------------------------- ### Application Lifecycle API Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Provides methods for getting application launch details and logging deep link results. ```APIDOC ## Application Lifecycle API Endpoints ### application_lifecycle_get_launch_details #### Description Retrieves detailed information about how the application was launched. #### Method GET #### Endpoint /api/application/lifecycle/launch_details ### application_lifecycle_log_deeplink_result #### Description Logs the result of a deep link operation. #### Method POST #### Endpoint /api/application/lifecycle/log_deeplink_result #### Parameters ##### Request Body - **tracking_id** (String) - Required - The tracking ID associated with the deep link. - **result** (LaunchResult) - Required - The result of the deep link operation. ``` -------------------------------- ### challenges_get_entries_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Requests an array of challenge entries with options for filtering and starting position. Results are returned asynchronously. ```APIDOC ## GET /challenges/{challenge_id}/entries ### Description Requests an array of challenge entries, with options for filtering and starting position. ### Method GET ### Endpoint `/challenges/{challenge_id}/entries` ### Parameters #### Path Parameters - **challenge_id** (int) - Required - The ID of the challenge whose entries to return. #### Query Parameters - **limit** (int) - Required - Defines the maximum number of entries to return. - **filter** (LeaderboardFilterType) - Optional - By using `LEADERBOARD_FILTER_FRIENDS`, this allows filtering returned values to bidirectional followers. - **start_at** (LeaderboardStartAt) - Optional - Defines whether to center the query on the user or start at the top of the challenge. ### Request Example ```json { "challenge_id": 123, "limit": 50, "filter": "LEADERBOARD_FILTER_FRIENDS", "start_at": "LEADERBOARD_START_AT_CENTERED_ON_VIEWER" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_ChallengeEntryArray) - An array of challenge entries if successful. - **message** (MetaPlatformSDK_Message) - The message object containing the challenge entry array. #### Response Example ```json { "data": [ { "user_id": 101, "rank": 5, "score": 1200 }, { "user_id": 102, "rank": 6, "score": 1150 } ] } ``` ``` -------------------------------- ### Get Installed Application Array (GDScript) Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Fetches an array of installed applications on the platform. This constant method takes no arguments and returns a MetaPlatformSDK_InstalledApplicationArray. ```gdscript var installed_apps = MetaPlatformSDK.get_installed_application_array() ``` -------------------------------- ### cowatching_request_to_present_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Requests to start a cowatching session as the presenter while copresent in home. Returns a MetaPlatformSDK_Request that emits a completed signal with a MetaPlatformSDK_Message. ```APIDOC ## POST /cowatching/request_to_present ### Description Submits a request to become the presenter in the current cowatching session within the Copresent Home environment. ### Method POST ### Endpoint /cowatching/request_to_present ### Parameters None ### Request Example None ### Response #### Success Response (200) - **message** (MetaPlatformSDK_Message) - An object containing the result of the operation. `is_success()` or `data` (boolean) indicates if the request to present was successful. #### Response Example ```json { "message": "MetaPlatformSDK_Message object" } ``` ``` -------------------------------- ### In-App Purchases - Get Next Product Array Page Async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves the next page of product entries. Returns a request object that emits a completion signal, which can then be used to get the product array. ```APIDOC ## POST /iap/get_next_product_array_page ### Description Gets the next page of IAP product entries. ### Method POST ### Endpoint /iap/get_next_product_array_page_async ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **handle** (MetaPlatformSDK_ProductArray) - Required - The handle for the current product array page. ### Request Example ```json { "handle": "current_product_array_handle" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_ProductArray) - The next page of product entries. #### Response Example ```json { "data": { "products": [ { "sku": "example_sku", "price": "1.99", "currency": "USD" } ] } } ``` ``` -------------------------------- ### HTTP Transfer and Application Data Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Methods for retrieving HTTP transfer updates and information about installed applications. ```APIDOC ## GET /http/transfer/update ### Description Retrieves a `MetaPlatformSDK_HttpTransferUpdate` object. This indicates the status of an ongoing HTTP transfer. ### Method GET ### Endpoint `/http/transfer/update` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **MetaPlatformSDK_HttpTransferUpdate** (object) - The HTTP transfer update object if available, otherwise null. #### Response Example ```json { "transfer_update": { "bytes_sent": 1024, "bytes_total": 4096 } } ``` ## GET /applications/installed ### Description Retrieves an array of `MetaPlatformSDK_InstalledApplication` objects, representing applications installed on the platform. ### Method GET ### Endpoint `/applications/installed` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **MetaPlatformSDK_InstalledApplicationArray** (array) - An array of installed application objects, or null if none are found. #### Response Example ```json { "installed_applications": [ { "id": "app_123", "name": "Example App" } ] } ``` ``` -------------------------------- ### Get Platform Initialize (GDScript) Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Fetches the platform initialization status. This constant method takes no arguments and returns a MetaPlatformSDK_PlatformInitialize object. ```gdscript var platform_init_status = MetaPlatformSDK.get_platform_initialize() ``` -------------------------------- ### Asset File Status by Name Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves the details of a specific asset file using its name, including its ID and installation status. ```APIDOC ## GET /asset/file/status/name/{asset_file_name} ### Description Gets the details on a single asset: ID, file name, and whether it's currently installed. ### Method GET ### Endpoint /asset/file/status/name/{asset_file_name} ### Parameters #### Path Parameters - **asset_file_name** (String) - Required - The asset file name. ### Request Example ```json null ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_AssetDetails) - An object containing the asset ID, file name, and installation status. - **is_error** (bool) - Indicates if the request resulted in an error. #### Response Example ```json { "data": { "asset_id": 12345, "file_name": "example_asset.file", "is_installed": true }, "is_error": false } ``` ``` -------------------------------- ### Asset File Status by ID Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves the details of a specific asset file using its ID, including its name and installation status. ```APIDOC ## GET /asset/file/status/{asset_file_id} ### Description Gets the details on a single asset: ID, file name, and whether it's currently installed. ### Method GET ### Endpoint /asset/file/status/{asset_file_id} ### Parameters #### Path Parameters - **asset_file_id** (int) - Required - The asset file ID. ### Request Example ```json null ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_AssetDetails) - An object containing the asset ID, file name, and installation status. - **is_error** (bool) - Indicates if the request resulted in an error. #### Response Example ```json { "data": { "asset_id": 12345, "file_name": "example_asset.file", "is_installed": true }, "is_error": false } ``` ``` -------------------------------- ### Platform Initialization Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Methods for initializing the Platform SDK, both synchronously and asynchronously. ```APIDOC ## POST /platform/initialize ### Description Synchronously initializes the Platform SDK. This method or initialize_platform_async must be called before calling any other methods (except for is_platform_initialized). ### Method POST ### Endpoint /platform/initialize ### Parameters #### Request Body - **app_id** (String) - Required - The "App ID" from the "API" tab within the developer dashboard. - **options** (Dictionary) - Optional - A Dictionary with the following keys: - **"disable_p2p_networking"** (Boolean) - Will disable peer-to-peer networking if set to `true`. - **"enable_cowatching"** (Boolean) - Will enable cowatching if set to `true`. ### Request Example ```json { "app_id": "YOUR_APP_ID", "options": { "disable_p2p_networking": false, "enable_cowatching": true } } ``` ### Response #### Success Response (200) - **result** (PlatformInitializeResult) - The result of the initialization. #### Response Example ```json { "result": { "success": true } } ``` ## POST /platform/initialize_async ### Description Asynchronously initializes the Platform SDK. This method or initialize_platform must be called before calling any other methods (except for is_platform_initialized). ### Method POST ### Endpoint /platform/initialize_async ### Parameters #### Request Body - **app_id** (String) - Required - The "App ID" from the "API" tab within the developer dashboard. ### Request Example ```json { "app_id": "YOUR_APP_ID" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_PlatformInitialize) - The platform initialization details if successful. #### Response Example ```json { "data": { "initialized": true } } ``` ``` -------------------------------- ### Platform Initialization API Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk APIs for initializing and checking the status of the platform SDK. ```APIDOC ## POST /initialize_platform ### Description Initializes the platform SDK with the provided application ID and options. ### Method POST ### Endpoint /initialize_platform ### Parameters #### Request Body - **app_id** (String) - Required - The application ID. - **options** (Dictionary) - Optional - Additional initialization options. ``` ```APIDOC ## POST /initialize_platform_async ### Description Asynchronously initializes the platform SDK with the provided application ID. ### Method POST ### Endpoint /initialize_platform_async ### Parameters #### Request Body - **app_id** (String) - Required - The application ID. ``` ```APIDOC ## GET /is_platform_initialized ### Description Checks if the platform SDK has been initialized. ### Method GET ### Endpoint /is_platform_initialized ``` -------------------------------- ### POST /application/start/app_download Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Initiates the download of an application. The function returns a request object that resolves when the download is complete, providing download results. ```APIDOC ## POST /application/start/app_download ### Description Initiates the download of an application. The function returns a request object that resolves when the download is complete, providing download results. Download progress can be monitored using `application_check_app_download_progress_async`. ### Method POST ### Endpoint /application/start/app_download ### Parameters None ### Request Example ```json (No request body) ``` ### Response #### Success Response (200) - **MetaPlatformSDK_Request** - A request object that emits a completed signal with a MetaPlatformSDK_Message. Check `is_error()` for success. If successful, use `get_app_download_result()` or access `.data` for a `MetaPlatformSDK_AppDownloadResult`. #### Response Example (Response is a request object that emits a signal upon completion) ``` -------------------------------- ### MetaPlatformSDK_ApplicationOptions Methods Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_applicationoptions This section details the methods available for configuring application launch options using the MetaPlatformSDK_ApplicationOptions class. ```APIDOC ## MetaPlatformSDK_ApplicationOptions ### Description Represents the options for launching an app. ### Methods #### `set_deeplink_message(value: String)` ##### Description A message to be passed to a launched app, which can be retrieved from MetaPlatformSDK.application_lifecycle_get_launch_details via the MetaPlatformSDK_LaunchDetails.deeplink_message property. ##### Parameters - **value** (String) - The deep link message to set. ##### Method void #### `set_destination_api_name(value: String)` ##### Description If provided, the intended destination to be passed to the launched app. ##### Parameters - **value** (String) - The name of the destination API. ##### Method void #### `set_lobby_session_id(value: String)` ##### Description If provided, the intended lobby where the launched app should take the user. All users with the same lobby_session_id should end up grouped together in the launched app. ##### Parameters - **value** (String) - The lobby session ID. ##### Method void #### `set_match_session_id(value: String)` ##### Description If provided, the intended instance of the destination that a user should be launched into. ##### Parameters - **value** (String) - The match session ID. ##### Method void ``` -------------------------------- ### POST /application/launch/other Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Launches a different application from the user's library. If the app is not installed, the user is redirected to its Oculus Store page. Returns a request object that emits a completed signal with a MetaPlatformSDK_Message. ```APIDOC ## POST /application/launch/other ### Description Launches a different application from the user's library. If the app is not installed, the user is redirected to its Oculus Store page. Returns a request object that emits a completed signal with a MetaPlatformSDK_Message. ### Method POST ### Endpoint /application/launch/other ### Parameters #### Query Parameters - **app_id** (int) - Required - The ID of the app to launch. - **deeplink_options** (MetaPlatformSDK_ApplicationOptions) - Optional - Additional configuration for this request. ### Request Example ```json { "app_id": 123456789, "deeplink_options": { "some_option": "value" } } ``` ### Response #### Success Response (200) - **MetaPlatformSDK_Message** - An object containing the result of the request. Check `is_error()` for success, and use `get_string()` or `.data` for the result (String). #### Response Example ```json { "message": "Application launched successfully." } ``` ``` -------------------------------- ### Rich Presence Get Destinations API Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Gets all the destinations that rich presence can be set to. This is useful for populating UI elements where users can choose to share their current game state. ```APIDOC ## GET /rich_presence/destinations ### Description Gets all the destinations that rich presence can be set to. This is useful for populating UI elements where users can choose to share their current game state. ### Method GET ### Endpoint /rich_presence/destinations ### Parameters #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json { "example": "No request body needed for this operation." } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_DestinationArray) - An array of available destinations for rich presence. #### Response Example ```json { "data": [ { "id": "", "name": "Destination Name 1" }, { "id": "", "name": "Destination Name 2" } ] } ``` ### Error Handling Check for errors using `MetaPlatformSDK_Message.is_error(message)`. ``` -------------------------------- ### cowatching_launch_invite_dialog_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Launches a dialog for inviting users to cowatch in Copresent Home. Returns a MetaPlatformSDK_Request that emits a completed signal with a MetaPlatformSDK_Message. ```APIDOC ## POST /cowatching/launch_invite_dialog ### Description Opens a dialog interface within Copresent Home, allowing users to invite others to join the cowatching session. ### Method POST ### Endpoint /cowatching/launch_invite_dialog ### Parameters None ### Request Example None ### Response #### Success Response (200) - **message** (MetaPlatformSDK_Message) - An object containing the result of the operation. `is_success()` or `data` (boolean) indicates if the dialog launch was successful. #### Response Example ```json { "message": "MetaPlatformSDK_Message object" } ``` ``` -------------------------------- ### In-App Purchases - Get Next Purchase Array Page Async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves the next page of purchase entries. Returns a request object that emits a completion signal, which can then be used to get the purchase array. ```APIDOC ## POST /iap/get_next_purchase_array_page ### Description Gets the next page of IAP purchase entries. ### Method POST ### Endpoint /iap/get_next_purchase_array_page_async ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **handle** (MetaPlatformSDK_PurchaseArray) - Required - The handle for the current purchase array page. ### Request Example ```json { "handle": "current_purchase_array_handle" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_PurchaseArray) - The next page of purchase entries. #### Response Example ```json { "data": { "purchases": [ { "sku": "example_purchase_sku", "purchase_time": "2023-10-27T10:00:00Z" } ] } } ``` ``` -------------------------------- ### challenges_get_entries_after_rank_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Requests an array of challenge entries starting after a specified rank. Results are delivered asynchronously. ```APIDOC ## GET /challenges/{challenge_id}/entries/after/{after_rank} ### Description Requests an array of challenge entries, starting after a specified rank. ### Method GET ### Endpoint `/challenges/{challenge_id}/entries/after/{after_rank}` ### Parameters #### Path Parameters - **challenge_id** (int) - Required - The ID of the challenge whose entries to return. - **after_rank** (int) - Required - The position after which to start. For example, 10 returns challenge results starting with the 11th user. #### Query Parameters - **limit** (int) - Optional - The maximum number of entries to return. ### Request Example ```json { "challenge_id": 123, "after_rank": 10, "limit": 50 } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_ChallengeEntryArray) - An array of challenge entries if successful. - **message** (MetaPlatformSDK_Message) - The message object containing the challenge entry array. #### Response Example ```json { "data": [ { "user_id": 456, "rank": 11, "score": 1000 }, { "user_id": 789, "rank": 12, "score": 950 } ] } ``` ``` -------------------------------- ### Get Type As String Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Returns a string representation of the message's type. This is a const method. ```cpp String get_type_as_string() const Returns a **String** representing the message type. ``` -------------------------------- ### Application Management API Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Manages application downloads, updates, and launching of other applications. ```APIDOC ## Application Management API Endpoints ### application_cancel_app_download_async #### Description Cancels the ongoing download of an application. #### Method POST #### Endpoint /api/application/download/cancel ### application_check_app_download_progress_async #### Description Checks the progress of an ongoing application download. #### Method GET #### Endpoint /api/application/download/progress ### application_get_version_async #### Description Retrieves the current version of the application. #### Method GET #### Endpoint /api/application/version ### application_install_app_update_and_relaunch_async #### Description Installs an application update and relaunches the application. #### Method POST #### Endpoint /api/application/update/install_relaunch #### Parameters ##### Request Body - **deeplink_options** (MetaPlatformSDK_ApplicationOptions) - Optional - Options for deep linking after relaunch. ### application_launch_other_app_async #### Description Launches another application on the platform. #### Method POST #### Endpoint /api/application/launch_other #### Parameters ##### Request Body - **app_id** (int) - Required - The ID of the application to launch. - **deeplink_options** (MetaPlatformSDK_ApplicationOptions) - Optional - Options for deep linking to the other application. ### application_start_app_download_async #### Description Starts the download of an application. #### Method POST #### Endpoint /api/application/download/start ``` -------------------------------- ### MetaPlatformSDK_InstalledApplicationArray Methods Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_installedapplicationarray Provides methods to access and manage the MetaPlatformSDK_InstalledApplicationArray. ```APIDOC ## MetaPlatformSDK_InstalledApplicationArray ### Description An array of MetaPlatformSDK_InstalledApplications. **NOTE:** This isn't a Godot **Array**, but you can loop over it using `for x in arr` just like a Godot **Array**. ### Methods #### get_element - **Description**: Returns an element in the array by index. - **Method**: const - **Parameters**: - **index** (int) - Required - The index of the element to retrieve. - **Returns**: MetaPlatformSDK_InstalledApplication #### size - **Description**: Returns the size of the array. - **Method**: const - **Returns**: int ``` -------------------------------- ### achievements_get_next_achievement_progress_array_page_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Gets the next page of achievement progress entries. Returns a MetaPlatformSDK_Request that emits a MetaPlatformSDK_Message on completion. ```APIDOC ## POST /achievements/progress/page/next ### Description Retrieves the subsequent page of achievement progress data. ### Method POST ### Endpoint /achievements/progress/page/next ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **handle** (MetaPlatformSDK_AchievementProgressArray) - Required - Handle to the current achievement progress array. ### Request Example ```json { "handle": "example_achievement_progress_array_handle" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_AchievementProgressArray) - The next page of achievement progress entries. - **message** (MetaPlatformSDK_Message) - A message object containing the result of the operation. #### Response Example ```json { "data": [ { "achievement_name": "first_win", "current_progress": 1, "max_progress": 1, "unlocked": true } ], "message": { "error": false, "data": "MetaPlatformSDK_AchievementProgressArray" } } ``` ``` -------------------------------- ### Get User Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_User from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_User get_user() const Returns a MetaPlatformSDK_User if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Get Purchase Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_Purchase from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_Purchase get_purchase() const Returns a MetaPlatformSDK_Purchase if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Launch Other App Async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Launches a different application in the user's library. If the target app is not installed, the user is redirected to its store page. This function returns a MetaPlatformSDK_Request that completes with a MetaPlatformSDK_Message. Check MetaPlatformSDK_Message.is_error() for success and use MetaPlatformSDK_Message.get_string() or .data for the result. ```gdscript MetaPlatformSDK_Request request = MetaPlatformSDK.application_launch_other_app_async(app_id, deeplink_options) request.completed.connect(func(message: MetaPlatformSDK_Message): if not message.is_error(): var result = message.get_string() # or message.data print("App launched successfully: ", result) else: print("Error launching app: ", message.get_error_message()) ) ``` -------------------------------- ### Platform Initialization Errors Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Defines the possible results when initializing the Oculus Platform SDK, indicating reasons for failure such as version mismatches, invalid credentials, or lack of entitlement. ```APIDOC ## Platform Initialization Errors ### Description Enumerates the possible outcomes of initializing the Oculus Platform SDK. ### Enumeration `PlatformInitializeResult` ### Members - **`PLATFORM_INITIALIZE_VERSION_MISMATCH`** (`-6`): The Oculus Platform SDK version used by the application does not match the version on the user's device. - **`PLATFORM_INITIALIZE_UNKNOWN`** (`-7`): An unspecified error occurred during initialization. - **`PLATFORM_INITIALIZE_INVALID_CREDENTIALS`** (`-8`): The Oculus user's account access token is invalid. - **`PLATFORM_INITIALIZE_NOT_ENTITLED`** (`-9`): The Oculus user does not own the entitlement for this application. ``` -------------------------------- ### Get Party Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_Party from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_Party get_party() const Returns a MetaPlatformSDK_Party if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Start App Download Async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Initiates an application download. The function returns a MetaPlatformSDK_Request that signals completion via the .completed signal with a MetaPlatformSDK_Message. Error checking is done via message.is_error(). The download result can be obtained using message.get_app_download_result() or message.data. ```gdscript var request = MetaPlatformSDK.application_start_app_download_async() request.completed.connect(func(message: MetaPlatformSDK_Message): if not message.is_error(): var download_result = message.get_app_download_result() # or message.data print("Download finished with status: ", download_result.status) else: print("Error starting download: ", message.get_error_message()) ) ``` -------------------------------- ### MetaPlatformSDK_LaunchDetails Class Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_launchdetails Details about the MetaPlatformSDK_LaunchDetails class, which represents information required for launching an application. It includes properties for deep linking, destination, launch source, launch type, session identifiers, and user information. ```APIDOC ## MetaPlatformSDK_LaunchDetails ### Description Represents details about launching an app. ### Properties - **deeplink_message** (String) - An opaque string provided by the developer to help them deeplink to content on app startup. - **destination_api_name** (String) - If provided, the intended destination the user would like to go to. - **launch_source** (String) - A string typically used to distinguish where the deeplink came from. For instance, a DEEPLINK launch type could be coming from events or rich presence. - **launch_type** (LaunchType) - A launch type that defines the different ways in which an application can be launched. - **lobby_session_id** (String) - If provided, the intended lobby the user would like to be in. - **match_session_id** (String) - If provided, the intended session the user would like to be in. - **tracking_id** (String) - A unique identifier to keep track of a user going through the deeplinking flow. - **users** (MetaPlatformSDK_UserArray) - If provided, the intended users the user would like to be with. This may be `null`, which indicates that the value is not present or that the current app or user is not permitted to access it. ### Inheritance Inherits from RefCounted. ``` -------------------------------- ### application_get_version_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Requests version information for the installed app and any available updates. Returns a MetaPlatformSDK_Request that emits a MetaPlatformSDK_Message on completion. ```APIDOC ## GET /application/version ### Description Retrieves version details for the current application and potential updates. ### Method GET ### Endpoint /application/version ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_ApplicationVersion) - Object containing current and update version information. - **message** (MetaPlatformSDK_Message) - A message object containing the result of the operation. #### Response Example ```json { "data": { "current_version_code": 10, "current_version_name": "1.0.0", "update_version_code": 12, "update_version_name": "1.1.0", "update_size": 50000000, "update_release_date": "2023-10-27T10:00:00Z" }, "message": { "error": false, "data": "MetaPlatformSDK_ApplicationVersion" } } ``` ``` -------------------------------- ### Get System VoIP Status Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves the current status of the system's VoIP. This is a constant time operation. ```APIDOC ## GET /voip/system/status ### Description Retrieves the current status of the system's VoIP. This method has no side effects. ### Method GET ### Endpoint `/voip/system/status` ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **data** (SystemVoipStatus) - The current status of the system VoIP. #### Response Example ```json { "data": { "status": "active" } } ``` ``` -------------------------------- ### MetaPlatformSDK_NetSyncOptions Methods Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_netsyncoptions This section details the methods available for the MetaPlatformSDK_NetSyncOptions class, allowing configuration of network synchronization options. ```APIDOC ## MetaPlatformSDK_NetSyncOptions ### Description Represents options for net sync. ### Methods #### `set_voip_group(value: String)` ##### Description If provided, immediately set the voip_group to this value upon connection. ##### Method `void` ##### Parameters - **value** (String) - Required - The desired voip group. #### `set_voip_stream_default(value: NetSyncVoipStreamMode)` ##### Description When a new remote voip user connects, default that connection to this stream type by default. ##### Method `void` ##### Parameters - **value** (NetSyncVoipStreamMode) - Required - The default stream mode for new voip users. #### `set_zone_id(value: String)` ##### Description Set the unique identifier within the current application grouping. ##### Method `void` ##### Parameters - **value** (String) - Required - The zone identifier. ``` -------------------------------- ### Get User Proof Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_UserProof from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_UserProof get_user_proof() const Returns a MetaPlatformSDK_UserProof if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### In-App Purchases - Get Products By SKU Async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Retrieves a list of IAP products that can be purchased, based on their SKUs. Returns a request object that emits a completion signal. ```APIDOC ## POST /iap/get_products_by_sku ### Description Retrieves a list of IAP products that can be purchased. ### Method POST ### Endpoint /iap/get_products_by_sku_async ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **skus** (PackedStringArray) - Required - The SKUs of the products to retrieve. ### Request Example ```json { "skus": ["sku1", "sku2", "sku3"] } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_ProductArray) - A list of IAP products. #### Response Example ```json { "data": { "products": [ { "sku": "sku1", "price": "1.99", "currency": "USD" } ] } } ``` ``` -------------------------------- ### iap_launch_checkout_flow_async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Launches the checkout flow for purchasing an item. Handles errors and returns purchase status. ```APIDOC ## POST /iap/launch_checkout_flow_async ### Description Launches the checkout flow to purchase the existing product. Oculus Home tries to handle and fix as many errors as possible. Home returns the appropriate error message and how to resolve it, if possible. Returns a purchase on success, empty purchase on cancel, and an error on error. ### Method POST ### Endpoint /iap/launch_checkout_flow_async ### Parameters #### Query Parameters - **sku** (String) - Required - IAP sku for the item the user wishes to purchase. ### Request Example ```json { "sku": "example_sku_123" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_Purchase) - The purchase details if successful. #### Response Example ```json { "data": { "productId": "example_sku_123", "purchaseToken": "example_token", "purchaseState": "PURCHASED" } } ``` #### Error Response (400) - **error** (MetaPlatformSDK_Error) - An error object detailing the issue. #### Error Response Example ```json { "error": { "code": 100, "message": "Invalid SKU" } } ``` ``` -------------------------------- ### Get User Array Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_UserArray from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_UserArray get_user_array() const Returns a MetaPlatformSDK_UserArray if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Get Purchase Array Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_PurchaseArray from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_PurchaseArray get_purchase_array() const Returns a MetaPlatformSDK_PurchaseArray if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Get Product Array Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_ProductArray from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_ProductArray get_product_array() const Returns a MetaPlatformSDK_ProductArray if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Avatar Editor Launch Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Launches the Avatar Editor interface for users to customize their avatars. ```APIDOC ## POST /avatar/editor/launch ### Description Launches the Avatar Editor. ### Method POST ### Endpoint /avatar/editor/launch ### Parameters #### Request Body - **options** (MetaPlatformSDK_AvatarEditorOptions) - Optional - Configuration options for the Avatar Editor. ### Request Example ```json { "options": { "initial_tab": "body", "show_settings": true } } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_AvatarEditorResult) - The result of launching the Avatar Editor. - **is_error** (bool) - Indicates if the request resulted in an error. #### Response Example ```json { "data": { "avatar_id": "user_avatar_123", "saved": true }, "is_error": false } ``` ``` -------------------------------- ### MetaPlatformSDK_ChallengeArray Methods Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_challengearray This section details the methods of the MetaPlatformSDK_ChallengeArray, including get_element, has_next_page, has_previous_page, and size. ```APIDOC ## MetaPlatformSDK_ChallengeArray Methods ### Description Provides methods for interacting with the MetaPlatformSDK_ChallengeArray. ### Methods - **get_element(index: int)** (MetaPlatformSDK_Challenge) - Returns an element in the array by index. - **has_next_page()** (bool) - Returns `true` if there is next page of elements. - **has_previous_page()** (bool) - Returns `true` if there is previous page of elements. - **size()** (int) - Returns the size of the array. ``` -------------------------------- ### Get Platform Initialize Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_PlatformInitialize from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_PlatformInitialize get_platform_initialize() const Returns a MetaPlatformSDK_PlatformInitialize if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Media Share to Facebook Async Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk Launches the Share to Facebook modal via a deeplink, allowing users to share local media files to Facebook. Requires file path and content type. ```APIDOC ## POST /media/share_to_facebook_async ### Description Launches the Share to Facebook modal via a deeplink to Home on Gear VR, allowing users to share local media files to Facebook. Returns a MetaPlatformSDK_Request which emits a `completed` signal with a MetaPlatformSDK_Message object. ### Method POST ### Endpoint /media/share_to_facebook_async ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **post_text_suggestion** (String) - Optional - Prepopulates the Facebook status text input box. - **file_path** (String) - Required - The path to the image file to be shared (must be in the app's internal storage directory). - **content_type** (MediaContentType) - Required - The type of media to share (only 'photo' is currently supported). ### Request Example ```json { "post_text_suggestion": "Check out my score!", "file_path": "/storage/emulated/0/my_app/screenshot.png", "content_type": "photo" } ``` ### Response #### Success Response (200) - **data** (MetaPlatformSDK_ShareMediaResult) - Contains the result of the media share operation. #### Response Example ```json { "data": { "success": true } } ``` ``` -------------------------------- ### Get PID Array Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_PidArray from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_PidArray get_pid_array() const Returns a MetaPlatformSDK_PidArray if that is the payload of this message; otherwise, it returns `null`. ``` -------------------------------- ### Get Party ID Source: https://godot-sdk-integrations.github.io/godot-meta-toolkit/api/class_metaplatformsdk_message Retrieves the MetaPlatformSDK_PartyID from a message payload. Returns null if the payload is not of this type. This is a const method. ```cpp MetaPlatformSDK_PartyID get_party_id() const Returns a MetaPlatformSDK_PartyID if that is the payload of this message; otherwise, it returns `null`. ```