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 typedef
std::function< void(jobject)>
Optionally set an IntentHandler function if you don't want to use your main Activity to launch Play Games UI.
OnLaunchedWithQuestCallback typedef
std::function< void(Quest)>
The callback type used with SetOnLaunchedWithQuest.
OnLaunchedWithSnapshotCallback typedef
std::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.
SetOnLaunchedWithQuest(OnLaunchedWithQuestCallback callback)
Registers a callback that will be called if the app is launched from the Play Games Destination App by selecting a quest.
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_QUEST(Quest quest)
void
The default callback called when the app is launched from the Play Games Destination App by selecting a quest.
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.

OnLaunchedWithQuestCallback

std::function< void(Quest)> OnLaunchedWithQuestCallback

The callback type used with SetOnLaunchedWithQuest.

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.

SetOnLaunchedWithQuest

AndroidPlatformConfiguration & SetOnLaunchedWithQuest(
  OnLaunchedWithQuestCallback callback
)

Registers a callback that will be called if the app is launched from the Play Games Destination App by selecting a quest.

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_QUEST

void DEFAULT_ON_LAUNCHED_WITH_QUEST(
  Quest quest
)

The default callback called when the app is launched from the Play Games Destination App by selecting a quest.

Logs the ID of the quest. This can be overridden by setting a new callback with SetOnLaunchedWithQuest.

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.

Logs the ID of the quest. This can be overridden by setting a new callback with SetOnLaunchedWithSnapshot.

傳送您對下列選項的寶貴意見...

這個網頁
Play Games Services for C++
Play Games Services for C++