Gamebase SDK for Android  1.2.0
Toast Gamebase Platform

◆ login() [3/3]

static void login ( final Activity  activity,
@NonNull final Map< String, Object >  credentialInfo,
@Nullable final GamebaseDataCallback< AuthToken >  callback 
)
static

Logs the user in with the credential of external authentication provider.

Parameters
activityThe activity which is starting the login process.
credentialInfoThe credentialInfo which is credential of authentication provider.
callbackLogin result callback,
returns the authentication token as a result of login.

Example Usage:

Map<String, Object> credential = new HashMap<>();
credential.put(AuthProviderCredentialConstants.PROVIDER_NAME, providerName);
credential.put(AuthProviderCredentialConstants.ACCESS_TOKEN, accessToken);
credential.put(AuthProviderCredentialConstants.ACCESS_TOKEN_SECRET, accessTokenSecret);
TAPSDK.login(activity, credential, new TAPDataCallback<AuthToken>() {
@Override
public void onCallback(AuthToken data, TAPException exception) {
if (TAPSDK.isSuccess(exception)) {
Log.d(TAG, "Login successful");
...
} else {
Log.e(TAG, "Login failed");
...
}
}
});