openCommunity
open fun openCommunity(@NonNull activity: Activity, @NonNull configuration: CommunityConfiguration, @Nullable onCloseCallback: GamebaseCallback)
Open community WebView which is set in NHN Cloud Gamebase Community Console. If the community URL is empty or invalid, you will receive a GamebaseException.
Example Usage:
CommunityConfiguration configuration = CommunityConfiguration.newBuilder()
.build();
Gamebase.Community.openCommunity(activity, configuration, new GamebaseCallback() {
@Override
public void onCallback(GamebaseException exception) {
if (Gamebase.isSuccess(exception)) {
// The user closed the community web view.
} else if (exception.getCode() == GamebaseError.UI_COMMUNITY_FAIL_INVALID_URL) {
// Please check the community URL field in the NHN Cloud Gamebase Community Console.
} else {
// Error occur when opening the community web view.
}
}
});
Content copied to clipboard
Since
Added 2.64.0.
Parameters
activity
Current activity.
configuration
The init settings of community URL.
onCloseCallback
called when the browser closed.