Binding Center
- Optional. Integrate the binding interface as needed. When calling this method, pass the corresponding binding channels to open the binding center page. After the user selects a binding method and completes binding, the binding type and binding result are returned through the callback.
Function
java
public static void gamedreamerBind(Context context, String [ ] bindList, GamedreamerBindListener gamedreamerBindListener)Request Parameter Description
| Parameter | Description |
|---|---|
| context | Context object |
| bindList | Binding channel array: binding types to display. Values are: 1. all (display all binding types) 2. phone (bind phone) 3. email (bind email) 4. fb (bind Facebook) 5. line (bind Line) 6. google (bind Google) 7. twitter (bind Twitter) 8. apple (bind Apple) |
| gamedreamerBindListener | Binding listener |
Callback Description
gamedreamerBindListener.onBindResult(HashMap<String, Object> hashMap) callback method description:
- This method is called when the player successfully binds on the binding center page.
Callback Parameter Description
| Parameter | Description |
|---|---|
| status | Binding result: success indicates success, already indicates already bound |
| binType | Binding type, such as "fb" or "line" |
Callback Description
gamedreamerBindListener.onClose() callback method description:
- This method is called when the player taps the close button in the upper-right corner of the binding center page.
Example Code
java
// "all" cannot be passed together with other types. If the parameters include both "all" and other types, the SDK processes it as "all" by default.
String [ ] bindList = new String[ ]{"all"};
or
String [ ] bindList = new String[ ]{"phone","email","fb","line","google","twitter","apple"};
// Parameter errors or binding failures are handled internally by the SDK. The developer does not need to handle them.
GDSDK.gamedreamerBind(this, bindList, new GamedreamerBindListener() {
@Override
public void onBindResult(HashMap<String, Object> hashMap) {
// Binding succeeded
String bindType = String.valueOf(hashMap.get("bindType"));
String status = String.valueOf(hashMap.get("status"));
// Already bound
String bindType = String.valueOf(hashMap.get("bindType"));
String status = String.valueOf(hashMap.get("status"));
}
@Override
public void onClose() {
// Page closed
}
});