更新日期:2024年 10月 24日游戏如何调用QuickSDK的隐私弹窗
<p style="white-space:normal;">
<span style="font-size:14px;"><span style="font-size:14px;">如果游戏做不了隐私弹窗,可按如下方式调用QuickSDK的弹窗接口</span></span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><span style="font-size:14px;"><br />
</span></span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><span style="font-size:14px;"><br />
</span></span>
</p>
<h3 style="white-space:normal;">
<span style="font-size:14px;">一、接口调用</span>
</h3>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<h4 style="white-space:normal;">
<span style="font-size:14px;">1. 安卓端接口调用</span>
</h4>
<p style="white-space:normal;">
<span style="font-size:16px;"><span style="font-size:14px;"><br />
</span></span>
</p>
<p style="white-space:normal;">
<span style="font-size:16px;"><span style="font-size:14px;">1.1 下载最新版本的SDK资源,替换里面的</span><span style="font-size:14px;">quicksdk_v2.7.4_20230322.jar</span></span>
</p>
<p style="white-space:normal;">
<span style="font-size:16px;"><span style="font-size:14px;"><br />
</span></span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">1.2 按下面示例调用代码</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:16px;"></span>
</p>
<pre class="brush:js;toolbar:false" style="font-size:medium;">Sdk.getInstance().showPrivace(this, new BaseCallBack() {
@Override
public void onSuccess(Object... objects) {
//玩家点击同意协议 可以申请敏感权限
}
@Override
public void onFailed(Object... objects) {
//玩家点击拒绝协议
}
});</pre>
<p style="white-space:normal;">
<span style="font-size:16px;"><span style="font-size:14px;color:#E53333;"><strong>游戏需自行判断是否为首次启动以及玩家是否同意过隐私政策。需玩家同意隐私政策后再申请权限(如果游戏以及要出包的渠道都不需要权限,则可以不申请),然后再执行初始化SDK</strong></span><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"></span>
</p>
<p style="white-space:normal;">
<span style="font-size:16px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">1.3 在母包assets里面,新建quicksdk.xml 并且写入以下数据</span>
</p>
<p style="white-space:normal;">
<span style="font-size:16px;"><img src="https://staticsite.quickapi.net/data/newFiles/20230328/20230328102154yEc6513.png" alt="" /><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:16px;"></span>
</p>
<pre class="brush:js;toolbar:false" style="font-size:medium;"><string name="PrivaceUrl">http://www.baidu.com</string> //隐私协议地址
<string name="UserUrl">http://www.baidu.com</string> //用户协议地址
</pre>
<p style="white-space:normal;">
<strong style="color:#E53333;font-size:14px;">如果此步骤未执行,点击界面上的【用户协议】以及【隐私政策】文字时将不会进行跳转</strong>
</p>
<p style="white-space:normal;">
<br />
</p>
<p style="white-space:normal;">
<br />
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">1.4 </span><span style="font-size:14px;">Unity接入,则在QuickSDK.cs下新增showPrivace()接口,来调起隐私弹窗</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"></span>
</p>
<pre class="brush:js;toolbar:false"> public void showPrivace()
{
QuickSDKImp.getInstance().callShowPrivace();
}
</pre>
<br style="white-space:normal;" />
<p style="white-space:normal;">
<span style="font-size:14px;">QuickSDKListener.cs下新增如下回调:</span>
</p>
<p style="white-space:normal;">
<br />
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"></span>
</p>
<pre class="brush:js;toolbar:false">public abstract void onPrivaceAgree();
public abstract void onPrivaceRefuse();</pre>
<p style="white-space:normal;">
<span style="font-size:14px;color:#E53333;"><strong>注意:接入资源需要下载</strong></span><span style="font-size:14px;color:#E53333;"><strong>2023-07-03及以后上传的版本</strong></span>
</p>
<p>
<br />
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<h4 style="white-space:normal;">
<span style="font-size:14px;">2. iOS端接口调用</span>
</h4>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><span style="font-size:14px;">2.1 需要下载</span><span style="font-size:14px;">2.6.1及以上版本的基础库进行替换</span></span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">2.2 按如下示例进行接口调用</span>
</p>
<p style="white-space:normal;">
<br />
</p>
<p style="white-space:normal;">
<br />
</p>
<pre class="brush:js;toolbar:false">/** 显示是否同意游戏用户协议和隐私政策弹窗-可点击查看在QK后台自定义的用户协议和隐私政策详情
* @param must 是否必须同意 YES:弹窗仅有同意按钮 NO同时显示不同意和同意按钮
* @param resultBlock 结果回调 YES玩家已经同意 NO玩家没有同意
*/
[SMPCQuickSDK.defaultInstance showGameCustomPrivacyViewMustAgree:YES result:^(BOOL hasAgreed) {
NSLog(@"user%@", hasAgreed ? @"hasagreed":@"hasnotagreed");
}];</pre>
<p>
<br />
</p>
<p>
<br />
</p>
<p>
<br />
</p>
<h4 style="white-space:normal;">
<span style="font-size:14px;">3. H5游戏转微端接口调用</span>
</h4>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span><span style="font-size:14px;"> </span>
</p>
<p style="font-size:medium;white-space:normal;">
<span style="font-size:14px;">H5游戏转出安卓或越狱渠道包,需</span><span style="font-size:14px;">游戏接入如下接口(注意此接口需要在初始化之前进行调用):</span>
</p>
<p style="font-size:medium;white-space:normal;">
<span style="font-size:14px;">QuickSDK.showPrivace(function(retMsg){ })</span>
</p>
<p style="font-size:medium;white-space:normal;">
<br />
</p>
<p style="font-size:medium;white-space:normal;">
<span style="font-size:14px;">当返回值是true时,代表玩家同意隐私协议</span><br />
<span style="font-size:14px;">当返回值是false时,代表玩家拒绝隐私协议</span><br />
<span style="font-size:14px;">玩家拒绝隐私协议后</span>
</p>
<p style="font-size:medium;white-space:normal;">
<span style="font-size:14px;">游戏需调用QuickSDK的退出接口 QuickSDK.callExtFunction("exit",{}) ;关闭游戏</span>
</p>
<p style="font-size:medium;white-space:normal;">
<br />
</p>
<p style="font-size:medium;white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<h3 style="font-size:medium;white-space:normal;">
<span style="font-size:14px;">二、后台配置</span>
</h3>
<p style="white-space:normal;">
<br />
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">1. 在</span><u style="font-size:14px;"><a href="https://www.quicksdk.com" target="_blank"><span style="font-size:14px;">QuickSDK后台</span></a></u><span style="font-size:14px;">新增2个自定义参数,分别为PrivaceUrl和UserUrl</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><img src="https://staticsite.quickapi.net/data/newFiles/20230328/20230328142639B6Op676.png" alt="" /><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><img src="https://staticsite.quickapi.net/data/newFiles/20230328/20230328142650oZ6L742.png" alt="" /><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">2. 点击渠道【配置】,填入隐私协议以及用户协议的链接地址</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><img src="https://staticsite.quickapi.net/data/newFiles/20230328/20230328143715YXSo936.png" alt="" /><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><img src="https://staticsite.quickapi.net/data/newFiles/20230328/20230328143850zng4670.png" alt="" /><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;">3. 保存参数,然后用打包工具打出渠道包</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<br />
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<h3 style="white-space:normal;">
<span style="font-size:14px;">三、 隐私弹窗界面显示效果</span>
</h3>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><img src="https://staticsite.quickapi.net/data/newFiles/20230328/20230328144205oDJz212.png" alt="" /><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><br />
</span>
</p>
<p style="white-space:normal;">
<span style="font-size:14px;"><span style="color:#E53333;font-size:14px;"><strong>PS:因</strong></span><span style="color:#E53333;font-size:14px;"><strong>母包隐私弹窗界面仅作测试使用,所以界面简洁并且信息并不完善 ,一切以打出渠道包的界面为准。渠道包显示的隐私弹窗界面如上图所示</strong></span></span>
</p>
<p style="white-space:normal;">
<br />
</p>