addMapping
Mapping the currently authenticated user identifier of Gamebase with another external authentication.
Example Usage:
Gamebase.addMapping(activity, AuthProvider.GOOGLE, new GamebaseDataCallback<AuthToken>() {
@Override
public void onCallback(AuthToken data, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
Log.d(TAG, "Add mapping successful");
} else {
Log.e(TAG, "Add mapping failed");
}
}
});
Since
Added 1.4.0.
Parameters
The activity which is starting the mapping process.
The providerName which is authentication provider.
Mapping result callback, returns the authentication token as a result of mapping.
See also
Mapping the currently authenticated user identifier of Gamebase with another external authentication.
Example Usage:
Gamebase.addMapping(activity, AuthProvider.GOOGLE, null, new GamebaseDataCallback<AuthToken>() {
@Override
public void onCallback(AuthToken data, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
Log.d(TAG, "Add mapping successful");
} else {
Log.e(TAG, "Add mapping failed");
}
}
});
Since
Added 1.4.0.
Parameters
The activity which is starting the mapping process.
The providerName which is authentication provider.
The additionalInfo which is additional information using for mapping.
Callbacks the results of mappings, returns the authentication token as a result of mappings.
See also
Mapping the currently authenticated user identifier of Gamebase with the credential of external authentication provider.
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);
Gamebase.addMapping(activity, credential, new GamebaseDataCallback<AuthToken>() {
@Override
public void onCallback(AuthToken data, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
Log.d(TAG, "Add mapping successful");
} else {
Log.e(TAG, "Add mapping failed");
}
}
});
Since
Added 1.4.0.
Parameters
The activity which is starting the login process.
The credentialInfo which is credential of authentication provider.
Mapping result callback, returns the authentication token as a result of mapping.