gpg:: AndroidPlatformConfiguration
#include <android_platform_configuration.h>
The platform configuration used when creating an instance of the GameServices class on Android.
Summary
Constructors and Destructors |
|
---|---|
AndroidPlatformConfiguration()
|
|
~AndroidPlatformConfiguration()
|
Public types |
|
---|---|
IntentHandler
|
typedefstd::function< void(jobject)>
Optionally set an IntentHandler function if you don't want to use your main Activity to launch Play Games UI. |
OnLaunchedWithSnapshotCallback
|
typedefstd::function< void(SnapshotMetadata)>
The callback type used with SetOnLaunchedWithSnapshot. |
Public functions |
|
---|---|
SetActivity(jobject android_app_activity)
|
You must set this to an Android Activity that is active for the lifetime of your application.
|
SetOnLaunchedWithSnapshot(OnLaunchedWithSnapshotCallback callback)
|
Registers a callback that will be called if the app is launched from the Play Games Destination App by selecting a snapshot.
|
SetOptionalIntentHandlerForUI(IntentHandler intent_handler)
|
Optionally set an IntentHandler function if you don't want to use your main Activity to launch Play Games UI.
|
SetOptionalViewForPopups(jobject android_view)
|
Sets the View to use as a content view for popups.
|
Valid() const
|
bool
Returns true if all required values were provided to the AndroidPlatformConfiguration.
|
Public static functions |
|
---|---|
DEFAULT_ON_LAUNCHED_WITH_SNAPSHOT(SnapshotMetadata snapshot)
|
void
The default callback called when the app is launched from the Play Games Destination App by selecting a snapshot.
|
Public types
IntentHandler
std::function< void(jobject)> IntentHandler
Optionally set an IntentHandler function if you don't want to use your main Activity to launch Play Games UI.
Provide a function that can start a provided UI intent at any point, using startActivityForResult.
The activity used to launch this intent must implement Activity.onActivityResult(). Forward the result to AndroidSupport::OnActivityResult. This function is declared in android_support.h.
OnLaunchedWithSnapshotCallback
std::function< void(SnapshotMetadata)> OnLaunchedWithSnapshotCallback
The callback type used with SetOnLaunchedWithSnapshot.
Public functions
AndroidPlatformConfiguration
AndroidPlatformConfiguration()
SetActivity
AndroidPlatformConfiguration & SetActivity( jobject android_app_activity )
You must set this to an Android Activity that is active for the lifetime of your application.
If you do not also set something for SetOptionalIntentHandlerForUI, then this activity will also be used to launch UI, and must implement Activity.onActivityResult(). Forward the result to AndroidSupport::OnActivityResult. This function is declared in android_support.h.
SetOnLaunchedWithSnapshot
AndroidPlatformConfiguration & SetOnLaunchedWithSnapshot( OnLaunchedWithSnapshotCallback callback )
Registers a callback that will be called if the app is launched from the Play Games Destination App by selecting a snapshot.
SetOptionalIntentHandlerForUI
AndroidPlatformConfiguration & SetOptionalIntentHandlerForUI( IntentHandler intent_handler )
Optionally set an IntentHandler function if you don't want to use your main Activity to launch Play Games UI.
Provide a function that can start a provided UI intent at any point, using startActivityForResult.
The activity used to launch this intent must implement Activity.onActivityResult(). Forward the result to AndroidSupport::OnActivityResult. This function is declared in android_support.h.
SetOptionalViewForPopups
AndroidPlatformConfiguration & SetOptionalViewForPopups( jobject android_view )
Sets the View to use as a content view for popups.
Valid
bool Valid() const
Returns true if all required values were provided to the AndroidPlatformConfiguration.
In this case, the only required value is the Activity.
~AndroidPlatformConfiguration
~AndroidPlatformConfiguration()
Public static functions
DEFAULT_ON_LAUNCHED_WITH_SNAPSHOT
void DEFAULT_ON_LAUNCHED_WITH_SNAPSHOT( SnapshotMetadata snapshot )
The default callback called when the app is launched from the Play Games Destination App by selecting a snapshot.
This can be overridden by setting a new callback with SetOnLaunchedWithSnapshot.