UE4 Api
<p>[TOC]</p>
<h2>文档记录</h2>
<table>
<thead>
<tr>
<th>编写日期</th>
<th>编写人员</th>
<th>文档版本</th>
<th>修改内容</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>2020.3.10</td>
<td>buck.yu</td>
<td>1.0.0</td>
<td>调整文档结构</td>
<td>无</td>
</tr>
</tbody>
</table>
<h2>文档简介</h2>
<p>MSSDK-UE4,只包含手机号登录功能。</p>
<p>该文档是 SDK 对外 API,方便开发者接入 SDK,有问题可以 <a href="https://www.showdoc.cc/mssdk?page_id=2615409307929897">联系我们</a>。</p>
<h2>重要信息</h2>
<p>本文档中涉及到的 <code>错误码</code> 可以参考下面链接的内容。</p>
<ul>
<li>错误码可以参考 <a href="https://www.showdoc.cc/mssdk?page_id=2629915269319032">SDK 错误码</a> 文档</li>
</ul>
<h4>SDK 初始化</h4>
<p>初始化sdk,使用sdk前必须调用该接口</p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">callback</td>
<td style="text-align: left;">MSCallback</td>
<td>初始化成功回调</td>
</tr>
</tbody>
</table>
<p><strong>回调声明:</strong></p>
<p>可以参考 <code>回调函数</code> 的说明。</p>
<p><strong>示例:</strong></p>
<p>```C++</p>
<p>void ULD_MainMenu::onInitClicked()
{
MSSDKHelper::GetInstance()->InitSDK(std::bind(&ULD_MainMenu::requestCallback, this, std::placeholders::_1, std::placeholders::_2));
}</p>
<p>void ULD_MainMenu::onInitClicked()
{
MSSDKHelper::GetInstance()->InitSDK(std::bind(&ULD_MainMenu::requestCallback, this, std::placeholders::_1, std::placeholders::_2));
}</p>
<pre><code>
#### 版本号
获取sdk版本号
|返回类型|说明|
|:-----|-----|
|FString&| 版本号|
**示例 **
```C++
FString version = MSSDKHelper::GetInstance()->Version()
</code></pre>
<h4>获取验证码</h4>
<p>获取手机号验证码</p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">phoneNum</td>
<td style="text-align: left;">const FString&</td>
<td>手机号</td>
</tr>
<tr>
<td style="text-align: left;">callback</td>
<td style="text-align: left;">MSCallback</td>
<td>接口回调</td>
</tr>
</tbody>
</table>
<p><strong>示例 </strong></p>
<p>```C++</p>
<pre><code>MSSDKHelper::GetInstance()->GetVerityCode(this->text_phone->GetText().ToString(), [](int ErrorCode, const FString& Msg) {
//TODO something
});</code></pre>
<p>}</p>
<pre><code>
#### 登陆
通过手机号和验证码登陆sdk。
|参数名|类型|说明|
|:----|:-----|-----|
|phoneNum|const FString&|手机号|
|code|const FString&|验证码|
|callback|MSCallback|接口回调|
**示例 **
```C++
MSSDKHelper::GetInstance()->LoginWithPhoneNum(this->text_phone->GetText().ToString(), this->text_code->GetText().ToString(), [](int ErrorCode, const FString& Msg){
//TODO something
});
</code></pre>