ForcingMappingTicket

If the addMapping API fails with error AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER (3302), you can force addMapping with this VO.

Example Usage:

void addMappingForcibly() {
    Gamebase.addMapping(activity, mappingProvider, new GamebaseDataCallback<AuthToken>() {
        @Override
        public void onCallback(AuthToken authToken, GamebaseException exception) {
            if (!Gamebase.isSuccess(exception)) {
                if (exception.getCode() == GamebaseError.AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER) {
                    // ForcingMappingTicket from GamebaseException
                    final ForcingMappingTicket ticket = ForcingMappingTicket.from(exception);
                    if (ticket != null) {
                        // Show the mappedUserId to be erased to the user, and ask whether or not to force addMapping.
                        ticket.mappedUserId;    // This userId will be erased.

                        Gamebase.addMappingForcibly(activity, mappingProvider, ticket.forcingMappingKey, new GamebaseDataCallback<AuthToken>() {
                            @Override
                            public void onCallback(AuthToken forceAddMappingAuthToken, GamebaseException forceAddMappingException) {
                                if (Gamebase.isSuccess(forceAddMappingException)) {
                                    // Force AddMapping Success.
                                    return;
                                }

                                // Force AddMapping Failed.
                            }
                        }
                    }
                } else {
                    // AddMapping Failed.
                }
                return;
            }

            // AddMapping Succeeded.
        }
    });
}

Since

Added 2.2.0

See also

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var idPCode: String
Link copied to clipboard
UserId that can be cleared by force mapping.
Link copied to clipboard
The status of mapped user.
Link copied to clipboard
open var subCode: String

Functions

Link copied to clipboard
Factory method to create VO instance.
Link copied to clipboard
open fun <T> fromJson(@NonNull json: String, classOfT: Class<T>): T
open fun <T> fromJson(@NonNull json: String, type: Type): T
open fun <T> fromJson(@NonNull jsonObject: JSONObject, classOfT: Class<T>): T
Link copied to clipboard
open fun toJsonString(): String
Link copied to clipboard
Link copied to clipboard
open fun toString(): String