Gamebase SDK for Android  2.41.1
NHN Cloud Gamebase Platform
ForcingMappingTicket Class Reference

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

Inheritance diagram for ForcingMappingTicket:
Inheritance graph
Collaboration diagram for ForcingMappingTicket:
Collaboration graph

Public Member Functions

String toJsonString ()
 
String toPrettyJsonString ()
 
String toString ()
 

Static Public Member Functions

static ForcingMappingTicket from (@NonNull final GamebaseException exception)
 Factory method to create VO instance. More...
 
static< T > T fromJson (@NonNull String json, Class< T > classOfT)
 
static< T > T fromJson (@NonNull JSONObject jsonObject, Class< T > classOfT)
 
static< T > T fromJson (@NonNull String json, Type type)
 

Public Attributes

String mappedUserId
 UserId that can be cleared by force mapping. More...
 
String idPCode
 
String forcingMappingKey
 
long expirationDate
 
String accessToken
 

Detailed Description

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

Since
Added 2.2.0

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.
}
});
}
See also
com.toast.android.gamebase.Gamebase#addMapping(Activity, String, GamebaseDataCallback)
com.toast.android.gamebase.Gamebase#addMapping(Activity, String, Map, GamebaseDataCallback)
com.toast.android.gamebase.Gamebase#addMapping(Activity, Map, GamebaseDataCallback)
com.toast.android.gamebase.Gamebase#addMappingForcibly(Activity, String, String, GamebaseDataCallback)
com.toast.android.gamebase.Gamebase#addMappingForcibly(Activity, String, String, Map, GamebaseDataCallback)
com.toast.android.gamebase.Gamebase#addMappingForcibly(Activity, Map, String, GamebaseDataCallback)
com.toast.android.gamebase.base.GamebaseException

Member Function Documentation

◆ from()

static ForcingMappingTicket from ( @NonNull final GamebaseException  exception)
static

Factory method to create VO instance.

Parameters
exceptionExtracts the VO class instance from this exception.
Returns
VO instance
Here is the call graph for this function:

◆ fromJson() [1/3]

static <T> T fromJson ( @NonNull JSONObject  jsonObject,
Class< T >  classOfT 
)
staticinherited
Here is the call graph for this function:

◆ fromJson() [2/3]

static <T> T fromJson ( @NonNull String  json,
Class< T >  classOfT 
)
staticinherited
Here is the caller graph for this function:

◆ fromJson() [3/3]

static <T> T fromJson ( @NonNull String  json,
Type  type 
)
staticinherited

◆ toJsonString()

String toJsonString ( )
inherited
Here is the caller graph for this function:

◆ toPrettyJsonString()

String toPrettyJsonString ( )
inherited

◆ toString()

String toString ( )
inherited

Reimplemented in TransferAccountRenewConfiguration.

Here is the call graph for this function:

Member Data Documentation

◆ accessToken

String accessToken

◆ expirationDate

long expirationDate

◆ forcingMappingKey

String forcingMappingKey

◆ idPCode

String idPCode

◆ mappedUserId

String mappedUserId

UserId that can be cleared by force mapping.