Stay organized with collections
Save and categorize content based on your preferences.
google::play::initialization
Summary
Enumerations
InitializationError
InitializationError
Error codes returned by Google Play Initialization.
Properties |
kActionRequiredShutdownClientProcess
|
The calling client process should shutdown as soon as possible.
This may be returned when a game is not launched via Google Play Games and is in the process of being relaunched.
|
kError
|
Fatal error during initialization.
|
kOk
|
The operation completed successfully.
|
kSdkRuntimeUpdateRequired
|
The current version of the SDK runtime installed on the device does not support the calling version of the SDK.
The user will need to update Google Play Games and the SDK runtime in order to proceed.
|
Typedefs
InitializeContinuation
std::function< void(InitializeResult)> InitializeContinuation
Functions
GooglePlayInitialize
void GooglePlayInitialize(
std::function< void(InitializeResult)> continuation
)
Establishes a connection to Play Services.
Must be called and return successfully before using any other API.
If initialization fails your application should exit and close any running processes as soon as possible.
Without a successful initialization your application can not use the Play PC SDK and critical checks such as ensuring that the user has a valid license to your application may have failed or could not be performed.
Details |
Parameters |
continuation
|
The async callback to return the data to.
|
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-03 UTC."],[],[],null,["# google::play::initialization Namespace\n\ngoogle::play::initialization\n============================\n\nSummary\n-------\n\n| ### Enumerations ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n| [InitializationError](#initialization_2enums_8h_1a1c5bed3e40cc5dd95c1c7c76be567afd)`{` ` `[kOk](#dummy_1a1c5bed3e40cc5dd95c1c7c76be567afdae69fa9a656f76dd8a4d89f21992b2d3a)` = 0,` ` `[kError](#dummy_1a1c5bed3e40cc5dd95c1c7c76be567afdae3587c730cc1aa530fa4ddc9c4204e97)` = 1,` ` `[kActionRequiredShutdownClientProcess](#dummy_1a1c5bed3e40cc5dd95c1c7c76be567afdaf2053df72c7651561461e3c0f9e41ff9)` = 2,` ` `[kSdkRuntimeUpdateRequired](#dummy_1a1c5bed3e40cc5dd95c1c7c76be567afda796ba96e94b64e3c49548e2712b99d4c)` = 3` `}` | enum Error codes returned by Google Play Initialization. |\n\n| ### Typedefs ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [InitializeContinuation](#initialization_2models_8h_1aceca9dfece2920329831393fb8348c20) | using `std::function\u003c void(`[InitializeResult](/games/playgames/native-pc/reference/class/google/play/result#classgoogle_1_1play_1_1_result)`)\u003e` |\n| [InitializeResult](#initialization_2models_8h_1a9ba665175025db9e1bd4bec8ea1e9934) | using [Result](/games/playgames/native-pc/reference/class/google/play/result#classgoogle_1_1play_1_1_result)`\u003c InitializationError, `[InitializeResultValue](/games/playgames/native-pc/reference/struct/google/play/initialization/initialize-result-value#structgoogle_1_1play_1_1initialization_1_1_initialize_result_value)` \u003e` |\n\n| ### Functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [GooglePlayInitialize](#initialization_8h_1acf5455686dff7dc883615803595cf5b9)`(std::function\u003c void(`[InitializeResult](/games/playgames/native-pc/reference/class/google/play/result#classgoogle_1_1play_1_1_result)`)\u003e continuation)` | `void` Establishes a connection to Play Services. |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|\n| [google::play::initialization::InitializeResultValue](/games/playgames/native-pc/reference/struct/google/play/initialization/initialize-result-value) | Result value for initialization. |\n\nEnumerations\n------------\n\n### InitializationError\n\n```text\n InitializationError\n``` \nError codes returned by Google Play Initialization.\n\n| Properties ||\n|----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kActionRequiredShutdownClientProcess` | The calling client process should shutdown as soon as possible. This may be returned when a game is not launched via Google Play Games and is in the process of being relaunched. |\n| `kError` | Fatal error during initialization. |\n| `kOk` | The operation completed successfully. |\n| `kSdkRuntimeUpdateRequired` | The current version of the SDK runtime installed on the device does not support the calling version of the SDK. The user will need to update Google Play Games and the SDK runtime in order to proceed. |\n\nTypedefs\n--------\n\n### InitializeContinuation\n\n```text\nstd::function\u003c void(InitializeResult)\u003e InitializeContinuation\n``` \n\n### InitializeResult\n\n```text\nResult\u003c InitializationError, InitializeResultValue \u003e InitializeResult\n``` \n\nFunctions\n---------\n\n### GooglePlayInitialize\n\n```text\nvoid GooglePlayInitialize(\n std::function\u003c void(InitializeResult)\u003e continuation\n)\n``` \nEstablishes a connection to Play Services.\n\nMust be called and return successfully before using any other API.\n\nIf initialization fails your application should exit and close any running processes as soon as possible.\n\nWithout a successful initialization your application can not use the Play PC SDK and critical checks such as ensuring that the user has a valid license to your application may have failed or could not be performed.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------|-------------------------------------------| | `continuation` | The async callback to return the data to. | |"]]