Android SDK API
<p>[TOC]</p>
<h2>Version Record</h2>
<table>
<thead>
<tr>
<th style="text-align: left;">Version number</th>
<th style="text-align: left;">Time</th>
<th style="text-align: left;">Modify content</th>
<th style="text-align: left;">Responsible person</th>
<th style="text-align: left;">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">V1.0.0</td>
<td style="text-align: left;">2018/12/20</td>
<td style="text-align: left;">First Time</td>
<td style="text-align: left;">Divin</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.0.1</td>
<td style="text-align: left;">2018/12/27</td>
<td style="text-align: left;">Rewritten</td>
<td style="text-align: left;">Fluty</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.0.2</td>
<td style="text-align: left;">2019/01/02</td>
<td style="text-align: left;">Align with iOS documentation</td>
<td style="text-align: left;">Fluty</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.0.3</td>
<td style="text-align: left;">2019/01/16</td>
<td style="text-align: left;">Add WeChat Share</td>
<td style="text-align: left;">Fluty</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.0.4</td>
<td style="text-align: left;">2019/01/17</td>
<td style="text-align: left;">Add QQ Share</td>
<td style="text-align: left;">Fluty</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.0.5</td>
<td style="text-align: left;">2019/03/18</td>
<td style="text-align: left;">Modify Application Lifecycle Incoming Parameters</td>
<td style="text-align: left;">Laimo</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.0.6</td>
<td style="text-align: left;">2019/03/20</td>
<td style="text-align: left;">New Channel Interface</td>
<td style="text-align: left;">Fluty</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.1.0</td>
<td style="text-align: left;">2019/05/15</td>
<td style="text-align: left;">Payment Interface Parameter Change</td>
<td style="text-align: left;">Fluty</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.2.0</td>
<td style="text-align: left;">2019/05/31</td>
<td style="text-align: left;">Route identification classification, and aligned with iOS</td>
<td style="text-align: left;">nic.huang</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">V1.5.1</td>
<td style="text-align: left;">2020/01/02</td>
<td style="text-align: left;">Add CAIS</td>
<td style="text-align: left;">nic.huang</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>
<h2>Introduction</h2>
<blockquote>
<p>MSSDK (Micro Services SDK), a user system based on a unified account, including login, payment, and data statistics (DLog).
This document is the SDK external API, which is convenient for developers to access the SDK. If you have any questions, you can contact the technical intermediate/standardized intermediate group.</p>
</blockquote>
<p><strong> Special attention: If the game developers are about to access is the type of online games (leisure games can be ignored), in order to login and pay security, the server access related interface is required. Specific access documents can be viewed <a href="https://www.showdoc.cc/mssdk?Page_id=26478972757260">MSSDK server documents</a></strong></p>
<h2>Event callback processing</h2>
<blockquote>
<p>It is mainly used by the SDK to notify the access party of some important event information, such as the user switching account success, logout and payment success.</p>
</blockquote>
<p><strong>A brief description:</strong>
For the results that the game needs to pay attention to throughout the life cycle, such as switching accounts, logging out, payment success, etc., the SDK will be provided in a notification callback. There are currently 3 notifications included: logout, switch account, and payment success. Only one notification class callback can be registered, using different cases to handle different notifications</p>
<p><strong>Function prototype:</strong> </p>
<pre><code class="language-java">public void registNotifyListener(MSLDNotifyListener listener);</code></pre>
<p><strong>Function parameter description:</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">parameter</th>
<th style="text-align: left;">type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td>Event ID, identifying specific events, see <a href="#jump_code">NotifyCode</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Prompt message</td>
</tr>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">Object</td>
<td>Event data, may be empty</td>
</tr>
</tbody>
</table>
<p>NotifyCode definition:</p>
<table>
<thead>
<tr>
<th style="text-align: left;">Event ID</th>
<th style="text-align: left;">Description</th>
<th style="text-align: left;">Event return data type</th>
<th style="text-align: left;">Return data description</th>
<th style="text-align: left;">Trigger scene description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">SWITCH_ACCOUNT</td>
<td style="text-align: left;">User switch account</td>
<td style="text-align: left;"><a href="#jump_code">MSLDAccount</a></td>
<td style="text-align: left;">Switched account object</td>
<td style="text-align: left;">After the user chooses to switch accounts in the personal center, select an account to log in, or the user selects the mobile phone in the process of selecting the mobile phone, and selects to retrieve the original, the event will be triggered.</td>
</tr>
<tr>
<td style="text-align: left;">LOGOUT</td>
<td style="text-align: left;">sign out</td>
<td style="text-align: left;"><a href="#jump_code">MSLDAccount</a></td>
<td style="text-align: left;">Logging out of the account object</td>
<td style="text-align: left;">When the user chooses to switch accounts in the personal center, the user will first exit the current account, thereby triggering the event. The user also triggers the event when the token expires during the use of the SDK functions.</td>
</tr>
<tr>
<td style="text-align: left;">PAY_SUCCESS</td>
<td style="text-align: left;">payment successful</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Order information, data is RSA encrypted data</td>
<td style="text-align: left;">user payment success callback, need to call [order consumption result report] (#jump_code) interface to report order information</td>
</tr>
<tr>
<td style="text-align: left;">POLICY_MINORS_PLAYTIMELIMIT</td>
<td style="text-align: left;">Policy needs--The time limit for minors</td>
<td style="text-align: left;">null</td>
<td style="text-align: left;">NO</td>
<td style="text-align: left;">The client detects the users ( minor ) has reached the time limit, the pop-up Prompt window, the event is triggered at the same time. Recommendations can perform a suspend operation at this time</td>
</tr>
<tr>
<td style="text-align: left;">POLICY_VISITOR_PLAYTIMELIMIT</td>
<td style="text-align: left;">Policy demands of tourists--A time limit</td>
<td style="text-align: left;">null</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">The client detects the users ( Visitors ) have reached the time limit, the pop-up bound mobile interfaces, this event is triggered at the same time. Recommendations can perform a suspend operation at this time</td>
</tr>
<tr>
<td style="text-align: left;">POLICY_MINORS_PAYMENTLIMIT</td>
<td style="text-align: left;">Policy needs--Pay restrictions for minors</td>
<td style="text-align: left;">null</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">The client detects the users ( minor ) has reached the maximum recharge, pop-up Prompt window, the event is triggered at the same time.</td>
</tr>
<tr>
<td style="text-align: left;">POLICY_VISITOR_PAYMENTLIMIT</td>
<td style="text-align: left;">Policy needs--tourists pay restrictions</td>
<td style="text-align: left;">null</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">The client detects the users ( Visitors ) have reached the maximum recharge, pop-up - bound cell phone interface, the event is triggered at the same time.</td>
</tr>
</tbody>
</table>
<p>MSLDAccount definition:</p>
<table>
<thead>
<tr>
<th style="text-align: left;">Field Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">playerId</td>
<td style="text-align: left;">String</td>
<td>player pid</td>
</tr>
<tr>
<td style="text-align: left;">nickName</td>
<td style="text-align: left;">String</td>
<td>nickname</td>
</tr>
<tr>
<td style="text-align: left;">avatarUrl</td>
<td style="text-align: left;">String</td>
<td>Avatar url address</td>
</tr>
<tr>
<td style="text-align: left;">phoneNumber</td>
<td style="text-align: left;">String</td>
<td>Mobile number (fourth to seventh digits are *)</td>
</tr>
<tr>
<td style="text-align: left;">phoneBound</td>
<td style="text-align: left;">boolean</td>
<td>has been bound to the phone</td>
</tr>
<tr>
<td style="text-align: left;">realnameVerified</td>
<td style="text-align: left;">boolean</td>
<td>whether real name information has been registered</td>
</tr>
<tr>
<td style="text-align: left;">newPlayer</td>
<td style="text-align: left;">boolean</td>
<td>is a new user</td>
</tr>
<tr>
<td style="text-align: left;">openId</td>
<td style="text-align: left;">String</td>
<td>Ledou open_id</td>
</tr>
<tr>
<td style="text-align: left;">sessionId</td>
<td style="text-align: left;">String</td>
<td>Login sessionID</td>
</tr>
<tr>
<td style="text-align: left;">gameId</td>
<td style="text-align: left;">String</td>
<td>Ledou game_id</td>
</tr>
<tr>
<td style="text-align: left;">passwordSetted</td>
<td style="text-align: left;">boolean</td>
<td>whether set password</td>
</tr>
<tr>
<td style="text-align: left;">realName</td>
<td style="text-align: left;">String</td>
<td>name</td>
</tr>
<tr>
<td style="text-align: left;">lastLoginTime</td>
<td style="text-align: left;">String</td>
<td>Last login time</td>
</tr>
</tbody>
</table>
<p>Order information definition:</p>
<blockquote>
<p>Data is RSA encrypted data, the game needs to use the public key for decryption. To prevent data from being tampered with, it is not recommended to decrypt at JAVA layer.
Public key:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa123Ng6hJxk4KwzAisNQiceR7
Uw+r2+lHnKPMiEc6cNo1CjwjcIZ9uA+Q4tRlPh2OG4a6JOpYttoaBx0OCrhiz3gP
uE8m7uYaA6PBvvk1zRXdwXqO0hvMMeOX6Bm07jfpmZNiMs7c8s31ekwxeaQNR4Ue
EcDM71nr/axUd8mw2wIDAQAB
After decryption, it is JSON data. For details, see the order data example.
Only the case where both success and status are 0 indicates that the payment is successful and the item can be issued. For details, see DEMO.</p>
</blockquote>
<table>
<thead>
<tr>
<th style="text-align: left;">Field Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">orderId</td>
<td style="text-align: left;">String</td>
<td>Order number</td>
</tr>
<tr>
<td style="text-align: left;">extraInfo</td>
<td style="text-align: left;">String</td>
<td>Payment information</td>
</tr>
<tr>
<td style="text-align: left;">success</td>
<td style="text-align: left;">String</td>
<td>Payment status: 0 is successful / Non-zero is failure</td>
</tr>
<tr>
<td style="text-align: left;">status</td>
<td style="text-align: left;">String</td>
<td>Order consumption status: 0 is consumed / non-zero is not consumed</td>
</tr>
</tbody>
</table>
<p>Example of order data:</p>
<pre><code class="language-java">{
"code": 200,
"msg": "success",
"result": [{
"orderId": "DD9440002176",
"openid": "0dbe69773dafcba60078c8213925efaf",
"amount": "0.01",
"actualAmount": "0.01",
"success": "0",
"gameparam": "paycallback",
"extraInfo": "9e44cdb1-0044-485b-bcac-dec5744b4d36",
"created": "1546506569",
"currency": "",
"act_currency": "CNY",
"sign": "b4042bff13b666cd499f80d1471a793b",
"status": "0"
}]
}</code></pre>
<p><strong>Interface example:</strong></p>
<pre><code class="language-java">MSLDSDK.registerNotifyListener(new MSLDNotifyListener() {
@Override
public void notify(int code, String msg, Object data) {
switch (code) {
case NotifyCode.SWITCH_ACCOUNT:
MSLDAccount account = (MSLDAccount )data;
break;
case NotifyCode.ACCOUNTINFO_UPDATED:
int field = (int) map.get("field");
if ((field & MSLDUserInfoField.MSLDUserInfoFieldPhone) > 0) {
}
int isNew = (int) map.get("isNew");
if ((isNew & MSLDUserInfoField.MSLDUserInfoFieldPhone) > 0) {
}
MSLDAccount account = (MSLDAccount)map.get("account");
break;
case NotifyCode.LOGOUT:
break;
case NotifyCode.PAY_SUCCESS:
break;
case NotifyCode.POLICY_MINORS_PLAYTIMELIMIT:
// The notufy for limit Juveniles play game when the timeout
break;
case NotifyCode.POLICY_VISITOR_PLAYTIMELIMIT:
// The notufy for limit guest to play game when the timeout
break;
case NotifyCode.POLICY_MINORS_PAYMENTLIMIT:
// The notufy for limit Juveniles to pay
break;
case NotifyCode.POLICY_VISITOR_PAYMENTLIMIT:
// The notufy for limit guest to pay
break;
default:
// 其他
break;
}
}
});</code></pre>
<h2>Asynchronous callback interface</h2>
<blockquote>
<p>SDK function prototype for asynchronous callbacks. This callback function is used in the following API interfaces.
Interface: MSLDCallback</p>
</blockquote>
<p><strong>Successful function prototype:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, T data);</code></pre>
<p><strong>Successful function parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">T</td>
<td>Successful result object, possibly null</td>
</tr>
</tbody>
</table>
<p><strong>Failed function prototype:</strong></p>
<pre><code class="language-java">Void onFail(int code, String msg, Object errorData);</code></pre>
<p><strong>Failed function parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td>Error Status Code</td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>Error result object, possibly null</td>
</tr>
</tbody>
</table>
<h2>API Details</h2>
<h3>Summary</h3>
<blockquote>
<p>package path: com.ms.sdk.api
Class: MSLDSDK
Description: The only API entry class that the SDK provides for game access. All open interfaces of the SDK will be output through this class.</p>
</blockquote>
<h4>1. Initialization</h4>
<p><strong>A brief description:</strong><br />
Initialize the SDK, it is recommended to call in the onCreate() of the game's main activity.<br />
<strong>Function prototype:</strong> </p>
<pre><code class="language-java">Void initSDK(Activity activity, MSLDCallback callback);</code></pre>
<p><strong>Function parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">this</td>
<td style="text-align: left;">Activity</td>
<td>Game Master Activity</td>
</tr>
<tr>
<td style="text-align: left;">callback</td>
<td style="text-align: left;">MSLDCallback</td>
<td>Initial callback</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong><br />
See the description of the asynchronous callback interface.<br />
<strong>Example:</strong> </p>
<pre><code class="language-java">MSLDSDK.getInstance().initSDK(this, new MSLDCallback() {
@Override
Void onSuccess(String msg, Object data) {
Show("Initial success");
}
@Override
Void onFail(int code, String msg, Object errorData) {
Show("initial failed");
}
});</code></pre>
<h4>2. Get configuration information</h4>
<p><strong>A brief description:</strong><br />
Get the configuration information of the current game.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function ID</th>
<th style="text-align: left;">Return Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Get Game Configuration</td>
<td style="text-align: left;">Synchronous Call</td>
<td style="text-align: left;">ROUTE_SDK_CONFIG</td>
<td style="text-align: left;"><a href="#jump_code">MSLDConfig</a></td>
</tr>
</tbody>
</table>
<p><strong>Return value description:</strong></p>
<p>MSLDConfig definition:</p>
<table>
<thead>
<tr>
<th style="text-align: left;">Field Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">isTrial</td>
<td style="text-align: left;">boolean</td>
<td>whether to review mode</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDConfig config = MSLDSDK.<MSLDConfig>syncAction(MainActivity.this, RoutePath.ROUTE_SDK_CONFIG,null);</code></pre>
<h4>3. Login</h4>
<blockquote>
<p>SDK provides three login APIs, login by opening the login panel (supporting Aurora one-click login, visitors, username and password, mobile number + verification code login), visitor login and automatic login.</p>
</blockquote>
<h5>3.1 Login Panel</h5>
<p><strong>A brief description:</strong><br />
Pull up the SDK login panel.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Login Panel</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;">AccountPath.ROUTE_ACCOUNT_LOGIN</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Interface MSLDCallback<MSLDAccount> {
Void onSuccess(String msg, MSLDAccount account);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Status Details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>Return object</td>
</tr>
<tr>
<td style="text-align: left;">account</td>
<td style="text-align: left;"><a href="#jump_code">MSLDAccount</a></td>
<td>Login successful user information</td>
</tr>
</tbody>
</table>
<p>MSLDAccount definition:</p>
<table>
<thead>
<tr>
<th style="text-align: left;">Field Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">playerId</td>
<td style="text-align: left;">String</td>
<td>player pid</td>
</tr>
<tr>
<td style="text-align: left;">nickName</td>
<td style="text-align: left;">String</td>
<td>nickname</td>
</tr>
<tr>
<td style="text-align: left;">avatarUrl</td>
<td style="text-align: left;">String</td>
<td>Avatar url address</td>
</tr>
<tr>
<td style="text-align: left;">phoneNumber</td>
<td style="text-align: left;">String</td>
<td>Mobile number (fourth to seventh digits are *)</td>
</tr>
<tr>
<td style="text-align: left;">phoneBound</td>
<td style="text-align: left;">boolean</td>
<td>has been bound to the phone</td>
</tr>
<tr>
<td style="text-align: left;">realnameVerified</td>
<td style="text-align: left;">boolean</td>
<td>whether real name information has been registered</td>
</tr>
<tr>
<td style="text-align: left;">newPlayer</td>
<td style="text-align: left;">boolean</td>
<td>is a new user</td>
</tr>
<tr>
<td style="text-align: left;">openId</td>
<td style="text-align: left;">String</td>
<td>乐逗open_id</td>
</tr>
<tr>
<td style="text-align: left;">sessionId</td>
<td style="text-align: left;">String</td>
<td>Login sessionID</td>
</tr>
<tr>
<td style="text-align: left;">gameId</td>
<td style="text-align: left;">String</td>
<td>乐逗game_id</td>
</tr>
<tr>
<td style="text-align: left;">passwordSetted</td>
<td style="text-align: left;">boolean</td>
<td>whether set password</td>
</tr>
<tr>
<td style="text-align: left;">realName</td>
<td style="text-align: left;">String</td>
<td>name</td>
</tr>
<tr>
<td style="text-align: left;">lastLoginTime</td>
<td style="text-align: left;">String</td>
<td>Last login time</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDSDK.action(this, AccountPath.ROUTE_ACCOUNT_LOGIN, new HashMap<>(), new
MSLDCallback<MSLDAccount>() {
@Override
Public void onSuccess(String msg, MSLDAccount data) {
}
@Override
Public void onFail(int code, String msg, Object errorData) {
}
});</code></pre>
<h5>3.2 Visitor Login</h5>
<p><strong>A brief description:</strong><br />
Log in to the SDK as a guest and log in to the same account when you call it repeatedly.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Login Panel</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;">AccountPath.ROUTE_ACCOUNT_GUEST_LOGIN</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Interface MSLDCallback<MSLDAccount> {
Void onSuccess(String msg, MSLDAccount account);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Status Details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>Return object</td>
</tr>
<tr>
<td style="text-align: left;">account</td>
<td style="text-align: left;"><a href="#jump_code">MSLDAccount</a></td>
<td>Login successful user information</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDSDK.action(this, AccountPath.ROUTE_ACCOUNT_GUEST_LOGIN, new HashMap<>(), new
MSLDCallback<MSLDAccount>() {
@Override
Public void onSuccess(String msg, MSLDAccount data) {
}
@Override
Public void onFail(int code, String msg, Object errorData) {
}
});</code></pre>
<h5>3.3 Automatic login</h5>
<p><strong>A brief description:</strong><br />
Log in using the account that the user has logged in. It is recommended to try to log in using this interface after the game is started. If the automatic login is not successful, then other login methods are displayed.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Login Panel</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;">AccountPath.ROUTE_ACCOUNT_AUTO_LOGIN</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Interface MSLDCallback<MSLDAccount> {
Void onSuccess(String msg, MSLDAccount account);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Status Details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>Return object</td>
</tr>
<tr>
<td style="text-align: left;">account</td>
<td style="text-align: left;"><a href="#jump_code">MSLDAccount</a></td>
<td>Login successful user information</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDSDK.action(this, AccountPath.ROUTE_ACCOUNT_AUTO_LOGIN, new HashMap<>(), new
MSLDCallback<MSLDAccount>() {
@Override
Public void onSuccess(String msg, MSLDAccount data) {
}
@Override
Public void onFail(int code, String msg, Object errorData) {
}
});</code></pre>
<h4>4. Open the User Center panel</h4>
<p><strong>A brief description:</strong><br />
Pull up the personal center panel.</p>
<p><strong>note:</strong><br />
To use this feature, you must integrate the MSLDSDK UI plugin and be logged in.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Personal Center Panel</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;">AccountPath.ROUTE_ACCOUNT_USER_CENTER</td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Interface MSLDCallback {
Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Status Details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>Return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDSDK.action(this, AccountPath.ROUTE_ACCOUNT_USER_CENTER, new
HashMap<String, Object>(), new MSLDCallback() {
@Override
Public void onSuccess(String msg, Object data) {
}
@Override
Public void onFail(int code, String msg, Object errorData) {
}
});</code></pre>
<h4>5. Get user information</h4>
<blockquote>
<p>This interface can get the data of the logged in user.</p>
</blockquote>
<p><strong>A brief description:</strong><br />
Get the currently logged in user information.</p>
<p><strong>note:</strong><br />
User information can be obtained only when logged in, no login returns empty</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function ID</th>
<th style="text-align: left;">Return Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Get User Information</td>
<td style="text-align: left;">Sync Call</td>
<td style="text-align: left;">AccountPath.ROUTE_ACCOUNT_LOGINED_USER_INFO</td>
<td style="text-align: left;"><a href="#jump_code">MSLDAccount</a></td>
</tr>
</tbody>
</table>
<p><strong>Return value description:</strong></p>
<p>MSLDAccount definition:</p>
<table>
<thead>
<tr>
<th style="text-align: left;">Field Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">playerId</td>
<td style="text-align: left;">String</td>
<td>player pid</td>
</tr>
<tr>
<td style="text-align: left;">nickName</td>
<td style="text-align: left;">String</td>
<td>nickname</td>
</tr>
<tr>
<td style="text-align: left;">avatarUrl</td>
<td style="text-align: left;">String</td>
<td>Avatar url address</td>
</tr>
<tr>
<td style="text-align: left;">phoneNumber</td>
<td style="text-align: left;">String</td>
<td>Mobile number (fourth to seventh digits are *)</td>
</tr>
<tr>
<td style="text-align: left;">phoneBound</td>
<td style="text-align: left;">boolean</td>
<td>has been bound to the phone</td>
</tr>
<tr>
<td style="text-align: left;">realnameVerified</td>
<td style="text-align: left;">boolean</td>
<td>whether real name information has been registered</td>
</tr>
<tr>
<td style="text-align: left;">newPlayer</td>
<td style="text-align: left;">boolean</td>
<td>is a new user</td>
</tr>
<tr>
<td style="text-align: left;">openId</td>
<td style="text-align: left;">String</td>
<td>乐逗open_id</td>
</tr>
<tr>
<td style="text-align: left;">sessionId</td>
<td style="text-align: left;">String</td>
<td>Login sessionID</td>
</tr>
<tr>
<td style="text-align: left;">gameId</td>
<td style="text-align: left;">String</td>
<td>乐逗game_id</td>
</tr>
<tr>
<td style="text-align: left;">passwordSetted</td>
<td style="text-align: left;">boolean</td>
<td>whether set password</td>
</tr>
<tr>
<td style="text-align: left;">realName</td>
<td style="text-align: left;">String</td>
<td>name</td>
</tr>
<tr>
<td style="text-align: left;">lastLoginTime</td>
<td style="text-align: left;">String</td>
<td>Last login time</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDAccount account = MSLDSDK.syncAction(this,AccountPath.ROUTE_ACCOUNT_LOGINED_USER_INFO,null);</code></pre>
<h4>6. Real name certification</h4>
<blockquote>
<p>Fast real-name authentication provided by the SDK.
Open real name authentication panel</p>
</blockquote>
<p><strong>A brief description:</strong><br />
Pull up the real name authentication panel.</p>
<p><strong>note:</strong><br />
To use this feature, you must integrate the MSLDSDKUI plugin and be logged in.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Real Name Authentication Panel</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;">AccountPath.ROUTE_ACCOUNT_AUTHENTICATION</td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">MSLDSDK.action(this, AccountPath.ROUTE_ACCOUNT_AUTHENTICATION, null, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("real name authentication succeeded");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("real name authentication failed" + msg);
}
});</code></pre>
<h4>7. Payment</h4>
<blockquote>
<p>SDK provides two payment APIs, which are paid by opening the payment panel (support Alipay and WeChat) and the specified payment method.
To avoid the risk of stolen brushes, the SDK adds payment verification processing. The game needs to follow</p>
</blockquote>
<h5>7.1 Payment Panel</h5>
<p><strong>A brief description:</strong><br />
Open the payment panel</p>
<p><strong>note:</strong><br />
To use this feature, you must be logged in.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Open Payment Panel</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;">PayPath.ROUTE_PAY_CHARGE</td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
<p><strong>HashMap parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PLAYER_ID</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Player Number</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_MCH_ORDER_NO</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Merchant order number, ie game CP order number, optional</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRODUCT_DES</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Product Description</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_SUBJECT</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Order Title</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRICE</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Price , value is float type string</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_ATTACH</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Transparent pass field, create success and query interface will return as it is</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRODUCT_LIST</td>
<td style="text-align: left;">JsonArray</td>
<td style="text-align: left;">Product Information List (An order may contain multiple items, see the access documentation for details)</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRODUCT_ID</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Item ID</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_QUANTITY</td>
<td style="text-align: left;">int</td>
<td style="text-align: left;">Purchase Quantity</td>
</tr>
</tbody>
</table>
<p>Transparent field definition:
When paying, pass the random number as <a href="#jump_code">extral </a>, <a href="#jump_code">extral </a> needs to be bound to the paid item and saved in the local database.
When [Event Callback Processing - Payment Success Notification] (#jump_code) is received, you need to decrypt it by RSA, get <a href="#jump_code">extral</a>, go to the local database by <a href="#jump_code">extral</a>, and then send the item. . And [order consumption result report] (#jump_code)</p>
<p><strong>Callback statement:</strong><br />
MSLDPayCallback definition</p>
<pre><code class="language-java">Void onComplete();
Void onCancel();
Void onFail(int code, String msg);</code></pre>
<p><strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Status Details</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
// merchandise payment direct incoming price
Map.put(PaymentParam.PAY_PLAYER_ID, "300012345");
Map.put(PaymentParam.PAY_MCH_ORDER_NO, "123456");
Map.put(PaymentParam.PAY_PRODUCT_DES, "Platform Payment Description");
Map.put(PaymentParam.PAY_SUBJECT, "Platform Payment Order Title");
Map.put(PaymentParam.PAY_PRICE, "6");
Map.put(PaymentParam.PAY_ATTACH, "transparent information");
// Platform payment platform needs to configure prop files can be imported into multiple props
Map.put(PaymentParam.PAY_PLAYER_ID, "300012345");
Map.put(PaymentParam.PAY_MCH_ORDER_NO, "123456");
Map.put(PaymentParam.PAY_PRODUCT_DES, "Platform Payment Description");
Map.put(PaymentParam.PAY_SUBJECT, "Platform Payment Order Title");
Map.put(PaymentParam.PAY_ATTACH, "transparent information");
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty(PaymentParam.PAY_PRODUCT_ID, "laimo_product");
jsonObject.addProperty(PaymentParam.PAY_QUANTITY, 1);
JsonArray jsonArray = new JsonArray();
jsonArray.add(jsonObject);
Map.put(PaymentParam.PAY_PRODUCT_LIST, jsonArray.toString());
MSLDSDK.action(this, PayPath.ROUTE_PAY_CHARGE, map, new
MSLDPayCallback() {
@Override
Public void onComplete() {
Show("Payment completed");
}
@Override
Public void onCancel() {
Show("payment cancellation");
}
@Override
Public void onFail(int code, String msg) {
Show(msg);
}
});</code></pre>
<h5>7.2 Specify payment method to pay</h5>
<p><strong>A brief description:</strong><br />
Designated payment method</p>
<p><strong>note:</strong><br />
To use this feature, you must be logged in.</p>
<p><strong>Function Description:</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Specify payment method payment</td>
<td style="text-align: left;">Asynchronous call</td>
<td style="text-align: left;">PayPath.ROUTE_PAY_BY_METHOD_ID</td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
<p><strong>HashMap parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PLAYER_ID</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Player Number</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_MCH_ORDER_NO</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Merchant order number, ie game CP order number, optional</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRODUCT_DES</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Product Description</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_SUBJECT</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Order Title</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRICE</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Price , value is float type string</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_ATTACH</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Transparent pass field, create success and query interface will return as it is</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRODUCT_LIST</td>
<td style="text-align: left;">JsonArray</td>
<td style="text-align: left;">Product Information List (An order may contain multiple items, see the access documentation for details)</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_PRODUCT_ID</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Item ID</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_QUANTITY</td>
<td style="text-align: left;">int</td>
<td style="text-align: left;">Purchase Quantity</td>
</tr>
<tr>
<td style="text-align: left;">PaymentParam.PAY_IDENTIFY</td>
<td style="text-align: left;">string</td>
<td style="text-align: left;">Payment ID, assigned by the music service console, WeChat payment: wxPay_H5/ Alipay: aliPay_H5</td>
</tr>
</tbody>
</table>
<p>Extral definition:
When paying, pass the random number as <a href="#jump_code">extral </a>, <a href="#jump_code">extral </a> needs to be bound to the paid item and saved in the local database.
When [Event Callback Processing - Payment Success Notification] (#jump_code) is received, you need to decrypt it by RSA, get <a href="#jump_code">extral</a>, go to the local database by <a href="#jump_code">extral</a>, and then send the item. . And [order consumption result report] (#jump_code)</p>
<p><strong>Callback statement:</strong><br />
MSLDPayCallback definition</p>
<pre><code class="language-java">Void onComplete();
Void onCancel();
Void onFail(int code, String msg);</code></pre>
<p><strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Status Details</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
// merchandise payment direct incoming price
Map.put(PaymentParam.PAY_PLAYER_ID, "300012345");
Map.put(PaymentParam.PAY_MCH_ORDER_NO, "123456");
Map.put(PaymentParam.PAY_PRODUCT_DES, "Platform Payment Description");
Map.put(PaymentParam.PAY_SUBJECT, "Platform Payment Order Title");
Map.put(PaymentParam.PAY_PRICE, "6");
Map.put(PaymentParam.PAY_ATTACH, "transparent information");
// Platform payment platform needs to configure prop files can be imported into multiple props
Map.put(PaymentParam.PAY_PLAYER_ID, "300012345");
Map.put(PaymentParam.PAY_MCH_ORDER_NO, "123456");
Map.put(PaymentParam.PAY_PRODUCT_DES, "Platform Payment Description");
Map.put(PaymentParam.PAY_SUBJECT, "Platform Payment Order Title");
Map.put(PaymentParam.PAY_ATTACH, "transparent information");
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty(PaymentParam.PAY_PRODUCT_ID, "laimo_product");
jsonObject.addProperty(PaymentParam.PAY_QUANTITY, 1);
JsonArray jsonArray = new JsonArray();
jsonArray.add(jsonObject);
Map.put(PaymentParam.PAY_PRODUCT_LIST, jsonArray.toString());
// Payment ID, assigned by the music service console, WeChat payment: wxPay_H5 alipay: aliPay_H5
Map.put(PaymentParam.PAY_IDENTIFY, "aliPay_H5");
MSLDSDK.action(this, PayPath.ROUTE_PAY_BY_METHOD_ID, map, new
MSLDPayCallback() {
@Override
Public void onComplete() {
Show("Payment completed");
}
@Override
Public void onCancel() {
Show("payment cancellation");
}
@Override
Public void onFail(int code, String msg) {
Show(msg);
}
});</code></pre>
<h5>7.3 Reporting the results of order consumption</h5>
<p><strong>A brief description:</strong><br />
Order consumption result report</p>
<p><strong>note:</strong><br />
To use this feature, you must receive [Event Callback Processing - Payment Success Notification] (#jump_code) and return data is not empty.</p>
<p><strong>Function Description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Order consumption result report</td>
<td style="text-align: left;">Asynchronous call</td>
<td style="text-align: left;">PayPath.ROUTE_PAY_REPORT_COMSUMED</td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
<p><strong>HashMap parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">orderId</td>
<td style="text-align: left;">String</td>
<td style="text-align: left;">Order ID</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#jump_code">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">HashMap<String, Object> params = new HashMap<>();
Params.put("orderId", "DD123456789");
MSLDSDK.action(this, PayPath.ROUTE_PAY_REPORT_COMSUMED, params, new MSLDCallback() {
@Override
Public void onSuccess(String s, @Nullable Object o) {
Log.i(TAG, "onSuccess: The result of the shipment has been notified successfully s = " + s);
}
@Override
Public void onFail(int i, String s, @Nullable Object o) {
Log.w(TAG, "onFail: The result of the shipment has been notified successfully i = " + i + "; s = " + s);
}
});</code></pre>
<p><strong>Remarks: </strong></p>
<h4>8. Life cycle</h4>
<h5>8.1 Application Lifecycle</h5>
<p><strong>Class: </strong> MSLDSDK.App
<strong>A brief description:</strong>
The application lifecycle listening interface has a total of five interfaces, and each interface needs to be accessed.</p>
<p><strong>Function prototype: </strong></p>
<pre><code class="language-java">Public static void onCreate(Application application)
Public static void attachBaseContext(Application application, Context base)
Public static void onLowMemory(Application application)
Public static void onTrimMemory(Application application, int level)
Public static void onConfigurationChanged(Application application, Configuration newConfig)</code></pre>
<p><strong>Example: </strong></p>
<pre><code class="language-java">MSLDSDK.App.onCreate(this);
MSLDSDK.App.attachBaseContext(this,base);
MSLDSDK.App.onLowMemory(this);
MSLDSDK.App.onTrimMemory(this,level);
MSLDSDK.App.onConfigurationChanged(this,newConfig);</code></pre>
<h5>8.2 Activity life cycle</h5>
<p><strong>Class: </strong> MSLDSDK.Act
<strong>A brief description:</strong>
The Activity lifecycle listening interface has a total of 11 interfaces, and each interface needs to be accessed.
<strong>Function prototype: </strong></p>
<pre><code class="language-java">Public static void onCreate(Activity activtiy, Bundle savedInstanceState);
Public static void onRestart(Activity activtiy);
Public static void onStart(Activity activtiy);
Public static void onResume(Activity activtiy);
Public static void onPause(Activity activtiy);
Public static void onStop(Activity activtiy);
Public static void onDestroy(Activity activtiy);
Public static void onSaveInstanceState(Activity activtiy, Bundle outState);
Public static void onNewIntent(Activity activity, Intent intent);
Public static void onActivityResult(Activity activtiy, int requestCode, int resultCode, Intent data);
Public static void onRequestPermissionsResult(Activity activtiy, int requestCode, String[] permissions, int[] paramArrayOfInt);</code></pre>
<p> <strong>Example: </strong></p>
<pre><code class="language-java">MSLDSDK.Act.onCreate(activtiy, savedInstanceState);
MSLDSDK.Act.onRestart(activtiy);
MSLDSDK.Act.onStart(activtiy);
MSLDSDK.Act.onResume(activtiy);
MSLDSDK.Act.onPause(activtiy);
MSLDSDK.Act.onStop(activtiy);
MSLDSDK.Act.onDestroy(activtiy);
MSLDSDK.Act.onSaveInstanceState(activtiy, outState);
MSLDSDK.Act.onNewIntent(intent);
MSLDSDK.Act.onActivityResult(activtiy, requestCode, resultCode, data);
MSLDSDK.Act.onRequestPermissionsResult(activtiy, requestCode, permissions, paramArrayOfInt);</code></pre>
<h4>9. Share</h4>
<blockquote>
<p>Provides functions such as sharing pictures and links in various scenarios of WeChat and QQ.</p>
</blockquote>
<h5>9.1 Query whether the current device is installed with WeChat or QQ.</h5>
<p><strong>A brief description</strong></p>
<p>Query whether the current device is installed with WeChat or QQ.</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Query whether the current device is installed with WeChat or QQ</td>
<td style="text-align: left;">sync call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_ISINSTALL</a></td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">appName</td>
<td style="text-align: left;">String</td>
<td>wechat or qq to query the app, WeChat or QQ</td>
</tr>
</tbody>
</table>
<p><strong>Return value description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">String</td>
<td>Is the incoming software installed, 1=installed, 0=not installed</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">String config = MSLDSDK.syncAction(MainActivity.this, SharePath.ROUTE_SHARE_ISINSTALL);</code></pre>
<h5>9.2 WeChat share pictures to session</h5>
<p><strong>A brief description</strong>
Share an image into a specified WeChat session</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Image</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_IMAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install WeChat before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">[String]</td>
<td>Share the scene, see the table below [RouteParam Description]()</td>
</tr>
<tr>
<td style="text-align: left;">image</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>The local path of the picture or the binary data of the picture, you need to convert byte[] to String type, the content size does not exceed 10MB</td>
</tr>
</tbody>
</table>
<p><strong>RouteParam Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene", ShareParam.SHARE_WECHAT_SESSION);
Map.put("image", "imagePath");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_IMAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.3 WeChat share pictures to circle of friends</h5>
<p><strong>A brief description</strong>
Share a picture into a circle of friends</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Image</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_IMAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install WeChat before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">[String]</td>
<td>Share the scene, see the table below [RouteParam Description]()</td>
</tr>
<tr>
<td style="text-align: left;">image</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>The local path of the picture or the binary data of the picture, you need to convert byte[] to String type, the content size does not exceed 10MB</td>
</tr>
</tbody>
</table>
<p><strong>RouteParam Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3344001">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene", ShareParam.SHARE_WECHAT_TIMELINE);
Map.put("image", "imagePath");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_IMAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.4 WeChat share link to session</h5>
<p><strong>A brief description</strong><br />
Share a link to a specified WeChat session</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Link</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_WEBPAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install WeChat before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>Share the scene, see the table below [RouteParam Description]()</td>
</tr>
<tr>
<td style="text-align: left;">thumbImage</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Button data of thumbnails, need to convert byte[] to String type, the content size does not exceed 32kb</td>
</tr>
<tr>
<td style="text-align: left;">webpageUrl</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link to share, no more than 10MB</td>
</tr>
<tr>
<td style="text-align: left;">title</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link title, content does not exceed 512b</td>
</tr>
<tr>
<td style="text-align: left;">description</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link description, content no more than 1kb</td>
</tr>
</tbody>
</table>
<p><strong>RouteParam Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3344001">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene", ShareParam.SHARE_WECHAT_SESSION);
Map.put("thumbImage", WechatUtils.toHexString(getBytes(file));
Map.put("webpageUrl", "Link to share");
Map.put("title", "link title");
Map.put("description", "link description");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_WEBPAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.5 WeChat Share Link to Friends Circle</h5>
<p><strong>A brief description</strong><br />
Share a link to a specified WeChat session</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Link</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_WEBPAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install WeChat before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>Share the scene, see the table below [RouteParam Description]()</td>
</tr>
<tr>
<td style="text-align: left;">thumbImage</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Button data of thumbnails, need to convert byte[] to String type, the content size does not exceed 32kb</td>
</tr>
<tr>
<td style="text-align: left;">webpageUrl</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link to share, no more than 10MB</td>
</tr>
<tr>
<td style="text-align: left;">title</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link title, content does not exceed 512b</td>
</tr>
<tr>
<td style="text-align: left;">description</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link description, content no more than 1kb</td>
</tr>
</tbody>
</table>
<p><strong>RouteParam Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3344001">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene", ShareParam.SHARE_WECHAT_TIMELINE);
Map.put("thumbImage", WechatUtils.toHexString(getBytes(file));
Map.put("webpageUrl", "Link to share");
Map.put("title", "link title");
Map.put("description", "link description");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_WEBPAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.6 WeChat sharing applet</h5>
<p><strong>A brief description</strong><br />
Share a small program to a specified WeChat session</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">WeChat sharing applet</td>
<td style="text-align: left;">Asynchronous call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_MINI_PROGRAM</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install WeChat before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Password Parameter</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">userName</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>WeChat applet original ID</td>
</tr>
<tr>
<td style="text-align: left;">path</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Open the path to the applet</td>
</tr>
<tr>
<td style="text-align: left;">miniprogramType</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">int</td>
<td>Small program scene type (0: official version 1: development version 2: experience version)</td>
</tr>
<tr>
<td style="text-align: left;">thumbImage</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>The binary data of the thumbnail image, you need to convert byte[] to String type, the content size does not exceed 128kb</td>
</tr>
<tr>
<td style="text-align: left;">webpageUrl</td>
<td style="text-align: left;">is a link to</td>
<td style="text-align: left;">String</td>
<td>compatible with WeChat low version, the content does not exceed 10MB</td>
</tr>
<tr>
<td style="text-align: left;">title</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link title, content does not exceed 512b</td>
</tr>
<tr>
<td style="text-align: left;">description</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link description, content no more than 1kb</td>
</tr>
<tr>
<td style="text-align: left;">withShareTicket</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Whether to share with shareTicket, @"1" = carry, @"0" = no, no by default</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="#http://10.72.14.5:8090/pages/viewpage.action?pageId=3344001">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("userName", "WeChat applet original ID");
Map.put("path", "pages/index");
Map.put("miniprogramType", "0");
Map.put("thumbImage", WechatUtils.toHexString(getBytes(file));
Map.put("webpageUrl", "Shared Link");
Map.put("title", "link title");
Map.put("description", "link description");
Map.put("withShareTicket", "0");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_MINI_PROGRAM, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.7 WeChat Open Small Program</h5>
<p><strong>A brief description</strong>
Open a specific applet</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">WeChat open small program</td>
<td style="text-align: left;">Asynchronous call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_LAUNCH_MINI_PROGRAM</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install WeChat before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Password Parameter</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">userName</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>WeChat applet original ID</td>
</tr>
<tr>
<td style="text-align: left;">path</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Open the path of the applet, do not fill in the default to open the applet home page</td>
</tr>
<tr>
<td style="text-align: left;">miniprogramType</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">int</td>
<td>Small program scene type (0: official version 1: development version 2: experience version)</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("userName", "WeChat applet original ID");
Map.put("path", "pages/index");
Map.put("miniprogramType", "0");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_LAUNCH_MINI_PROGRAM, map, null);</code></pre>
<h5>9.8 QQ Share pictures to friends</h5>
<p><strong>A brief description</strong>
Share a picture into the specified QQ session</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Image</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_IMAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install QQ before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>Share the scene, see the table below</td>
</tr>
<tr>
<td style="text-align: left;">image</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>The local path of the image, the corresponding image content size does not exceed 10MB</td>
</tr>
</tbody>
</table>
<p><strong>Share scene description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene",RouteParam.SHARE_QQ_FRIENDS);
Map.put("image", "imagePath");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_IMAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.9 QQ sharing pictures to Qzone</h5>
<p><strong>A brief description</strong><br />
Share a picture to Qzone</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Image</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_IMAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install QQ before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>Share the scene, see the table below</td>
</tr>
<tr>
<td style="text-align: left;">image</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>The local path of the image, the corresponding image content size does not exceed 10MB</td>
</tr>
</tbody>
</table>
<p><strong>Share scene description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong>
</p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene",ShareParam.SHARE_QQ_QZONE);
Map.put("image", "imagePath");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_IMAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.10 QQShare link to friends</h5>
<p><strong>A brief description</strong><br />
Share a link to the specified QQ session</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Link</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_WEBPAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install QQ before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>Share the scene, see the table below [RouteParam Description]()</td>
</tr>
<tr>
<td style="text-align: left;">thumbImage</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Button data of thumbnails, need to convert byte[] to String type, the content size does not exceed 32kb</td>
</tr>
<tr>
<td style="text-align: left;">webpageUrl</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link to share, no more than 10MB</td>
</tr>
<tr>
<td style="text-align: left;">title</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link title, content does not exceed 512b</td>
</tr>
<tr>
<td style="text-align: left;">description</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link description, content no more than 1kb</td>
</tr>
</tbody>
</table>
<p><strong>RouteParam Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong> Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3344001">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene", ShareParam.SHARE_QQ_FRIENDS);
Map.put("thumbImage", WechatUtils.toHexString(getBytes(file));
Map.put("webpageUrl", "Link to share");
Map.put("title", "link title");
Map.put("description", "link description");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_WEBPAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>
<h5>9.11 QQ share link to Qzone</h5>
<p><strong>A brief description</strong><br />
Share a link to Qzone</p>
<p><strong>Function Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Function Name</th>
<th style="text-align: left;">Invocation Type</th>
<th style="text-align: left;">Function Identification</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Share Link</td>
<td style="text-align: left;">Asynchronous Call</td>
<td style="text-align: left;"><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3343984">SharePath.ROUTE_SHARE_WEBPAGE</a></td>
<td style="text-align: left;">Please call the interface to determine whether to install QQ before using this function.</td>
</tr>
</tbody>
</table>
<p><strong>Parameter Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Already defined as constant</th>
<th style="text-align: left;">type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">scene</td>
<td style="text-align: left;">Yes</td>
<td style="text-align: left;">String</td>
<td>Share the scene, see the table below [RouteParam Description]()</td>
</tr>
<tr>
<td style="text-align: left;">thumbImage</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Button data of thumbnails, need to convert byte[] to String type, the content size does not exceed 32kb</td>
</tr>
<tr>
<td style="text-align: left;">webpageUrl</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link to share, no more than 10MB</td>
</tr>
<tr>
<td style="text-align: left;">title</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link title, content does not exceed 512b</td>
</tr>
<tr>
<td style="text-align: left;">description</td>
<td style="text-align: left;">No</td>
<td style="text-align: left;">String</td>
<td>Link description, content no more than 1kb</td>
</tr>
</tbody>
</table>
<p><strong>RouteParam Description</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_SESSION</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat session</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_WECHAT_TIMELINE</td>
<td style="text-align: left;">String</td>
<td>Share to WeChat circle</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_FRIENDS</td>
<td style="text-align: left;">String</td>
<td>Share to QQ friends</td>
</tr>
<tr>
<td style="text-align: left;">ShareParam.SHARE_QQ_QZONE</td>
<td style="text-align: left;">String</td>
<td>Share to QQ space</td>
</tr>
</tbody>
</table>
<p><strong>Callback statement:</strong></p>
<pre><code class="language-java">Void onSuccess(String msg, Object data);
Void onFail(int code, String msg, Object errorData);</code></pre>
<p>
<strong>Callback parameter description:</strong></p>
<table>
<thead>
<tr>
<th style="text-align: left;">Parameter Name</th>
<th style="text-align: left;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td><a href="http://10.72.14.5:8090/pages/viewpage.action?pageId=3344001">error code</a></td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>Error details</td>
</tr>
<tr>
<td style="text-align: left;">errorData</td>
<td style="text-align: left;">Object</td>
<td>return object</td>
</tr>
</tbody>
</table>
<p><strong>Example:</strong></p>
<pre><code class="language-java">HashMap<String, Object> map = new HashMap<String, Object>();
Map.put("scene", ShareParam.SHARE_QQ_QZONE);
Map.put("thumbImage", WechatUtils.toHexString(getBytes(file));
Map.put("webpageUrl", "Link to share");
Map.put("title", "link title");
Map.put("description", "link description");
MSLDSDK.action(this, SharePath.ROUTE_SHARE_WEBPAGE, map, new MSLDCallback() {
@Override
Public void onSuccess(String msg, @Nullable Object data) {
Show("share success");
}
@Override
Public void onFail(int code, String msg, @Nullable Object errorData) {
Show("Share failed" + msg);
}
});</code></pre>