0

Requesting permissions required by user actions
Whenever a user performs an action that requires a scope that isn't requested at sign-in, call GoogleSignIn.hasPermissions to check if the user has already granted the required permissions. If not, call GoogleSignIn.requestPermissions to launch an activity that requests the additional required scopes from the user.

For example, if a user performs an action that requires access to their Drive app storage, do the following:

02-08 11:07:54.138 2393-2995/com.google.android.gms E/Volley: [113] BasicNetwork.performRequest: Unexpected response code 404 for https://www.googleapis.com/drive/v2beta/apps/self?prettyPrint=false&fields=id

02-08 11:07:54.138 2393-2826/com.google.android.gms W/NetworkResponseErrorDec: StatusCode:404 Reason:[notFound] Location:[app]
02-08 11:07:54.138 4074-4724/? I/GamesNativeSDK: Error connecting to Google Play: code 8.
02-08 11:07:54.138 4074-4202/? I/TeapotNativeActivity: Sign in finished with a result of -3

--------------------------------------------------------------------------------------------------------------------------------

if open .EnableSnapshots()!!DELETE .EnableSnapshots()!  Verification passed

--------------------------------------------------------------------------------------------------------------------------------

 

https://github.com/sdkbox/sdkbox-sample-gpg/blob/master/cpp/Classes/StateManager.cpp

sdkbox-sample-gpg/cpp/Classes/StateManager.cpp

void StateManager::Init(gpg::PlatformConfiguration &pc) {

LOGI("Initializing Services");

if (!gameServices)

{

LOGI("Uninitialized services, so creating");

gameServices = gpg::GameServices::Builder()

.SetOnAuthActionFinished([](gpg::AuthOperation op, gpg::AuthStatus status){

LOGI("Sign in finished with a result of %d", status);

if( status == gpg::AuthStatus::VALID ){

gameServices->Players().FetchSelf([=](gpg::PlayerManager::FetchSelfResponse const &response) {

if (gpg::IsSuccess(response.status)) {

PlayerID = response.data.Id();

PlayerName = response.data.Name();

}

});

isSignedIn = true;

}

else{

isSignedIn = false;

}

if(_callback)

{

_callback( op, status);

}

} )

.SetOnMultiplayerInvitationEvent([](gpg::MultiplayerEvent evt, std::string msg, gpg::MultiplayerInvitation inv){

})

.EnableSnapshots()

.SetDefaultOnLog(gpg::LogLevel::VERBOSE)

.Create(pc);

}

LOGI("Created");

}

yinjimmy commented

    Question stats

    • Active
    • Views394 times
    • Answers0 answers
    • Followers1 follower

    Categories