Gamebase SDK for Android  1.3.0
Toast Gamebase Platform

◆ addMapping() [2/3]

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

Mapping the currently authenticated user identifier of Gamebase with the credential of external authentication provider.

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

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.addMapping(activity, credential, new TAPDataCallback<AuthToken>() {
@Override
public void onCallback(AuthToken data, TAPException exception) {
if (TAPSDK.isSuccess(exception)) {
Log.d(TAG, "Add mapping successful");
...
} else {
Log.e(TAG, "Add mapping failed");
...
}
}
});