Gamebase SDK for Android  2.41.1
NHN Cloud Gamebase Platform
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:

ContactConfiguration configuration = ContactConfiguration.newBuilder()
.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.
}
}
});
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:

Gamebase.Contact.openContact(activity, null, 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.
}
}
});
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:

ContactConfiguration configuration = ContactConfiguration.newBuilder()
.setUserName(userName)
.build();
Gamebase.Contact.requestContactURL(configuration, new GamebaseDataCallback<String>() {
@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.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:

Gamebase.Contact.requestContactURL(new GamebaseDataCallback<String>() {
@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.