Gamebase SDK for Android 2.44.2
NHN Cloud Gamebase Platform
Loading...
Searching...
No Matches
Gamebase.TemporaryWithdrawal Class Reference

This class provides functionality related to temporary withdrawal. More...

Collaboration diagram for Gamebase.TemporaryWithdrawal:
Collaboration graph

Static Public Member Functions

static void requestWithdrawal (@NonNull Activity activity, @Nullable GamebaseDataCallback< TemporaryWithdrawalInfo > callback)
 Request to withdraw. More...
 
static void cancelWithdrawal (@NonNull Activity activity, @Nullable GamebaseCallback callback)
 If the user has requested to withdraw, cancel it. More...
 
static void withdrawImmediately (@NonNull Activity activity, @Nullable GamebaseCallback callback)
 This function ignores the withdrawal grace period and proceeds withdrawal immediately. More...
 

Detailed Description

This class provides functionality related to temporary withdrawal.

Member Function Documentation

◆ cancelWithdrawal()

static void cancelWithdrawal ( @NonNull Activity  activity,
@Nullable GamebaseCallback  callback 
)
static

If the user has requested to withdraw, cancel it.


If the user has never requested to leave, the function call will fail.

Since
Added 2.9.0.
Parameters
activityThe activity which is starting the mapping process.
callbackCallbacks the result of cancel withdrawal.

Example Usage:

public static void testCancelWithdraw() {
@Override
public void onCallback(final GamebaseException exception) {
if (!Gamebase.isSuccess(exception)) {
// Never requested temporary withdrawal before.
} else {
// Cancel temporary withdrawal failed.
return;
}
}
// Cancel temporary withdrawal success.
}
});
}
This class provides functionality related to temporary withdrawal.
Definition: Gamebase.java:1486
static void cancelWithdrawal(@NonNull Activity activity, @Nullable GamebaseCallback callback)
If the user has requested to withdraw, cancel it.
Definition: Gamebase.java:1580
This class is a wrapper class that is provided to use various features of Gamebase platform.
Definition: Gamebase.java:59
static boolean isSuccess(@Nullable final GamebaseException exception)
Returns true if the GamebaseException object is null or the error code is zero.
Definition: Gamebase.java:158
Class responsible for creating error codes and error objects.
Definition: GamebaseError.java:23
static final int AUTH_WITHDRAW_NOT_TEMPORARY_WITHDRAW
Definition: GamebaseError.java:133
An object that contains the success or failure of the execution of the Gamebase function.
Definition: GamebaseException.java:26
int getCode()
Get result code.
Definition: GamebaseException.java:157
Definition: GamebaseCallback.java:9
See also
com.toast.android.gamebase.GamebaseCallback.

◆ requestWithdrawal()

static void requestWithdrawal ( @NonNull Activity  activity,
@Nullable GamebaseDataCallback< TemporaryWithdrawalInfo callback 
)
static

Request to withdraw.


If the user who requested the withdrawal logs in, you can check the grace expiration time through the AuthToken.getTemporaryWithdrawalInfo().getGracePeriodDate().

Since
Added 2.9.0.
Parameters
activityThe activity which is starting the mapping process.
callbackCallbacks the result of requesting withdrawal.

Example Usage:

// Request withdrawal
public static void testRequestWithdraw() {
@Override
public void onCallback(TemporaryWithdrawalInfo data GamebaseException exception) {
if (!Gamebase.isSuccess(exception)) {
// Already requested temporary withdrawal before.
} else {
// Request temporary withdrawal failed.
return;
}
}
// Request temporary withdrawal success.
}
});
}
// Login after requested withdrawal
public static void testLogin() {
Gamebase.login(activity, provider, new GamebaseDataCallback<AuthToken>() {
@Override
public void onCallback(AuthToken data, GamebaseException exception) {
if (!Gamebase.isSuccess(exception)) {
// Login failed
return;
}
// Check if user is requesting withdrawal
if (data.getTemporaryWithdrawalInfo() != null) {
// User is under temporary withdrawal
long gracePeriodDate = data.getTemporaryWithdrawalInfo().getGracePeriodDate();
} else {
// Login success.
}
}
});
}
static void requestWithdrawal(@NonNull Activity activity, @Nullable GamebaseDataCallback< TemporaryWithdrawalInfo > callback)
Request to withdraw.
Definition: Gamebase.java:1544
Definition: TemporaryWithdrawalInfo.java:10
static final int AUTH_WITHDRAW_ALREADY_TEMPORARY_WITHDRAW
Definition: GamebaseError.java:132
See also
com.toast.android.gamebase.auth.data.TemporaryWithdrawalInfo.
com.toast.android.gamebase.GamebaseDataCallback.
com.toast.android.gamebase.Gamebase#login(Activity, String, GamebaseDataCallback)
com.toast.android.gamebase.auth.data.AuthToken.

◆ withdrawImmediately()

static void withdrawImmediately ( @NonNull Activity  activity,
@Nullable GamebaseCallback  callback 
)
static

This function ignores the withdrawal grace period and proceeds withdrawal immediately.


Internally, this function works exactly the same as the com.toast.android.gamebase.Gamebase#withdraw(Activity, GamebaseCallback).

Since
Added 2.9.0
Parameters
activityThe activity which is starting the mapping process.
callbackCallbacks the result of withdraw.

Example Usage:

public static void testWithdrawImmediately() {
@Override
public void onCallback(final GamebaseException exception) {
if (!Gamebase.isSuccess(exception)) {
// Withdraw failed.
return;
}
// Withdraw success.
}
});
}
static void withdrawImmediately(@NonNull Activity activity, @Nullable GamebaseCallback callback)
This function ignores the withdrawal grace period and proceeds withdrawal immediately.
Definition: Gamebase.java:1613
See also
com.toast.android.gamebase.GamebaseCallback.
com.toast.android.gamebase.Gamebase#withdraw(Activity, GamebaseCallback).
Here is the call graph for this function: