Gamebase SDK for Android 2.50.0
NHN Cloud Gamebase Platform
Loading...
Searching...
No Matches
Gamebase.Contact Class Reference

This class provides wrapping of function execution related to TOAST Contact. More...

Collaboration diagram for Gamebase.Contact:
Collaboration graph

Static Public Member Functions

static void openContact (@NonNull final Activity activity, @Nullable final GamebaseCallback onCloseCallback)
 Open TOAST Contact WebView with CS URL which is wrote in TOAST Gamebase App Console. More...
 
static void openContact (@NonNull final Activity activity, @NonNull final ContactConfiguration configuration, @Nullable final GamebaseCallback onCloseCallback)
 Open TOAST Contact WebView with CS URL which is wrote in TOAST Gamebase App Console. More...
 
static void requestContactURL (@NonNull final GamebaseDataCallback< String > callback)
 Returns the customer service URL. More...
 
static void requestContactURL (@NonNull final ContactConfiguration configuration, @NonNull final GamebaseDataCallback< String > callback)
 Returns the customer service URL. More...
 

Detailed Description

This class provides wrapping of function execution related to TOAST Contact.

Member Function Documentation

◆ openContact() [1/2]

static void openContact ( @NonNull final Activity  activity,
@NonNull final ContactConfiguration  configuration,
@Nullable final GamebaseCallback  onCloseCallback 
)
static

Open TOAST Contact WebView with CS URL which is wrote in TOAST Gamebase App Console.

If the CS URL is empty or invalid, you will receive a GamebaseException.

Since
Added 2.16.0.
Parameters
activityCurrent activity.
configurationThe init settings of contact URL.
onCloseCallbackcalled when the browser closed.

Example Usage:

.setUserName(userName)
.build();
Gamebase.Contact.openContact(activity, configuration, new GamebaseCallback() {
@Override
public void onCallback(GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// The user closed the contact web view.
} else if (exception.getCode() == GamebaseError.UI_CONTACT_FAIL_INVALID_URL) {
// Please check the customer URL field in the TOAST Gamebase Console.
} else {
// Error occur when opening the contact web view.
}
}
});
This class provides wrapping of function execution related to TOAST Contact.
Definition: Gamebase.java:2279
static void openContact(@NonNull final Activity activity, @Nullable final GamebaseCallback onCloseCallback)
Open TOAST Contact WebView with CS URL which is wrote in TOAST Gamebase App Console.
Definition: Gamebase.java:2306
This class is a wrapper class that is provided to use various features of Gamebase platform.
Definition: Gamebase.java:61
static boolean isSuccess(@Nullable final GamebaseException exception)
Returns true if the GamebaseException object is null or the error code is zero.
Definition: Gamebase.java:160
Class responsible for creating error codes and error objects.
Definition: GamebaseError.java:23
static final int UI_CONTACT_FAIL_INVALID_URL
Definition: GamebaseError.java:177
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
Builder setUserName(@NonNull String userName)
Set the user name.
Definition: ContactConfiguration.java:95
ContactConfiguration build()
This method creates an instance of ContactConfiguration.
Definition: ContactConfiguration.java:83
Parameter class for the initialization of Gamebase.Contact.openContact().
Definition: ContactConfiguration.java:24
static Builder newBuilder()
The factory method to create an instance of the builder to build ContactConfiguration.
Definition: ContactConfiguration.java:64
Definition: GamebaseCallback.java:9
See also
com.toast.android.gamebase.contact.ContactConfiguration.
com.toast.android.gamebase.GamebaseCallback.

◆ openContact() [2/2]

static void openContact ( @NonNull final Activity  activity,
@Nullable final GamebaseCallback  onCloseCallback 
)
static

Open TOAST Contact WebView with CS URL which is wrote in TOAST Gamebase App Console.

If the CS URL is empty or invalid, you will receive a GamebaseException.

Since
Added 2.5.0.
Parameters
activityCurrent activity.
onCloseCallbackcalled when the browser closed.

Example Usage:

@Override
public void onCallback(GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// The user closed the contact web view.
} else if (exception.getCode() == GamebaseError.UI_CONTACT_FAIL_INVALID_URL) {
// Please check the customer URL field in the TOAST Gamebase Console.
} else {
// Error occur when opening the contact web view.
}
}
});
See also
com.toast.android.gamebase.GamebaseCallback.

◆ requestContactURL() [1/2]

static void requestContactURL ( @NonNull final ContactConfiguration  configuration,
@NonNull final GamebaseDataCallback< String >  callback 
)
static

Returns the customer service URL.

You can open webview with this URL.

Since
Added 2.16.0.
Parameters
configurationThe init settings of contact URL.
callbackReturns the customer service URL.

Example Usage:

.setUserName(userName)
.build();
@Override
public void onCallback(String customerServiceURL, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// Succeeded.
} else if (exception.getCode() == GamebaseError.UI_CONTACT_FAIL_INVALID_URL) {
// Please check the customer URL field in the TOAST Gamebase Console.
} else {
// Failed.
}
}
});
static void requestContactURL(@NonNull final GamebaseDataCallback< String > callback)
Returns the customer service URL.
Definition: Gamebase.java:2373
Generic callback interface that returns data.
Definition: GamebaseDataCallback.java:12
See also
com.toast.android.gamebase.contact.ContactConfiguration.
com.toast.android.gamebase.GamebaseDataCallback.

◆ requestContactURL() [2/2]

static void requestContactURL ( @NonNull final GamebaseDataCallback< String >  callback)
static

Returns the customer service URL.

You can open webview with this URL.

Since
Added 2.16.0.
Parameters
callbackReturns the customer service URL.

Example Usage:

@Override
public void onCallback(String customerServiceURL, GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// Succeeded.
} else if (exception.getCode() == GamebaseError.UI_CONTACT_FAIL_INVALID_URL) {
// Please check the customer URL field in the TOAST Gamebase Console.
} else {
// Failed.
}
}
});
See also
com.toast.android.gamebase.GamebaseDataCallback.