惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Proofpoint News Feed
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
Scott Helme
Scott Helme
S
Securelist
美团技术团队
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
AI
AI
L
Lohrmann on Cybersecurity
S
Security Affairs
Cloudbric
Cloudbric
SecWiki News
SecWiki News
爱范儿
爱范儿
雷峰网
雷峰网
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
大猫的无限游戏
大猫的无限游戏
N
News and Events Feed by Topic
I
InfoQ
S
Secure Thoughts
AWS News Blog
AWS News Blog
A
About on SuperTechFans
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
The Last Watchdog
The Last Watchdog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Check Point Blog
P
Palo Alto Networks Blog
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News
Latest news
Latest news
I
Intezer
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
D
Docker

博客园 - 威少小二orz

团结引擎抖音小游戏一定要手动填缓存资源域名 团结引擎+Addressable+Instant Game打包抖音小游戏 团结引擎发布抖音小游戏(十万个坑已踩完) 团结引擎发布小游戏区分不同平台 团结引擎发布小游戏与js版本SDK的互相调用 Unity发布京东小游戏 LayerMask的使用规范 Unity RectTransform中使用stretch模式时代码动态控制Left、Top、Right、Bottom Unity使用https请求握手失败的处理方案 【MAUI开发】一、初识MAUI Android中使用GSON解析JSON数据 游戏软著渠道的用户协议和隐私协议方案(启动显示方案) C#文件夹复制 C#在Json序列化中动态忽略某些属性或字段 安卓多个Activity大退时自动重启的问题处理 C#中接收到的Json数据中key为数字的问题处理 对于UniWebView这种组件违规获取信息的处理 Unity使用Get和Post传递json数据并转换成class对象 Unity获取手机本地应用以及调起apk安装、启动app、安装完成回调 Unity接入穿山甲GroMore广告——重构偏2(Banner广告)
TapTap实名认证-Android
威少小二orz · 2023-01-05 · via 博客园 - 威少小二orz

我这边使用的是Android版。

导入防沉迷SDK,从官网下载。

  implementation(name: "AntiAddiction_3.16.5", ext: "aar") // 防沉迷 SDK
        implementation(name: "AntiAddictionUI_3.16.5", ext: "aar") // 防沉迷 SDK
        implementation(name: "TapCommon_3.16.5", ext: "aar")

以下是安卓代码:

从启动的activity的onCreate那里调用:

里面的app这个参数为当前主activity的全局变量,app = this。

public static void TapTapAntiAddiction()
    {
        Config config = new Config.Builder()
            .withClientId("----*****-----") // TapTap 开发者中心对应 Client ID
            .enableTapLogin(false)      // 是否启动 TapTap 快速认证
            .showSwitchAccount(false)    // 是否显示切换账号按钮
            .build();

         AntiAddictionUIKit.init(app, config, new AntiAddictionUICallback() {
         @Override
         public void onCallback(int code, Map<String, Object> extras) {
        // Log.d("~~~~TapTap-AntiAddiction", "code:"+code);
         if (code == Constants.ANTI_ADDICTION_CALLBACK_CODE.LOGIN_SUCCESS){
        // Log.d("~~~~TapTap-AntiAddiction", "玩家登录后判断当前玩家可以进行游戏");

         }else if(code == Constants.ANTI_ADDICTION_CALLBACK_CODE.REAL_NAME_STOP){
         showToast("您的账号没有进行实名认证",Toast.LENGTH_LONG);
         AlertDialog.Builder builder = new AlertDialog.Builder(app);
         builder.setTitle("游戏温馨提示").setMessage("根据国家防沉迷通知的相关要求," +
                                 "所有用户必须使用真实有效身份信息进行实名认证,建议您完成实名认证再进行游戏。");
         builder.setPositiveButton("知道了",new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface dialog,int whichButton) {
             app.finish();
             android.os.Process.killProcess(android.os.Process.myPid());
             System.exit(0);
       // onExitApp();
         }
         });
         builder.setCancelable(false);
         builder.show();
         }
//         else if (code == Constants.ANTI_ADDICTION_CALLBACK_CODE.REAL_NAME_STOP)
//         {
//             app.finish();
//             android.os.Process.killProcess(android.os.Process.myPid());
//             System.exit(0);
//
//         }
         }

         });

         String userIdentifier = oaid;
         AntiAddictionUIKit.startup(app, userIdentifier);

    }