Skip to content

Member Center (required) ​

Required. In the game, players can open the Member Center by calling this method. The Member Center provides functions such as displaying user information, binding a mobile phone or email, claiming game packages, viewing event announcements, opening customer service, checking orders, and logging out.

Image ​

Member Center view

Method 1 ​

java
// Default Member Center method
public static void gamedreamerMemberCenter(Context context,GamedreamerMemberListener gamedreamerMemberListener)

Method 2 ​

java
// Member Center method with close and binding callbacks
public static void gamedreamerMemberCenter(Context context,GamedreamerMemberBindListener gamedreamerMemberBindListener)
  • Call either method according to the game's requirements.

Method 1 Parameter Description ​

ParameterDescription
contextContext object
gamedreamerMemberListenerAccount logout listener

Callback Description ​

GamedreamerMemberListener.onLogout() callback method description:

  • This method is called when the player clicks the "Exit" button in the Member Center.

Example Code ​

java
// Default Member Center method
GDSDK.gamedreamerMemberCenter(this, new GamedreamerMemberListener() {
		@Override
		public void onLogout() {
			// Called when the player clicks Exit in the Member Center; the game can return to the login page.
			DEMOActivity.launchLogin(GameActivity.this);
			finish();
		}
});

Method 2 Parameter Description ​

ParameterDescription
contextContext object
gamedreamerMemberBindListenerAccount logout, Member Center close, and binding listener

onLogout Callback Description ​

gamedreamerMemberBindListener.onLogout() callback method description:

  • This method is called when the player clicks the "Exit" button in the Member Center.

onClose Callback Description ​

gamedreamerMemberBindListener.onClose() callback method description:

  • This method is called when the player clicks the close button in the upper-right corner of the Member Center.

onBind Callback Description ​

gamedreamerMemberBindListener.onBind(final HashMap<String, Object> hashMap) callback method description:

  • This method is called when the player successfully binds any channel in the Member Center.

Example Code ​

java
// Member Center method with close and binding callbacks
GDSDK.gamedreamerMemberCenter(this, new GamedreamerMemberBindListener() {
		@Override
		public void onLogout() {
			// Called when the player clicks Exit in the Member Center; the game can return to the login page.
			DEMOActivity.launchLogin(GameActivity.this);
			finish();
		}
		@Override
		public void onClose() {
			// Called when the player clicks the close button in the upper-right corner of the Member Center.
		}
		@Override
		public void onBind(final HashMap<String, Object> hashMap) {
			// Called when a channel is successfully bound; returns the binding information.
			String bindType = String.valueOf(hashMap.get("bindType")); // Binding type, such as "fb".
		}
});