Go to file
xiaoyi 461cdabf4a Merge branch 'feat/tdsuser' of git.gametaptap.com:tds/client-sdk/tds-sdk-all/tapsdk2/tapsdk2-unity into feat/tdsuser 2021-07-15 14:24:24 +08:00
Documentation doc: TDSUser 2021-07-15 06:04:16 +00:00
Plugins feat: login scene add testqualification case 2021-07-15 14:24:11 +08:00
CHANGELOG.md feat: update Bootstrap and Login changeLog 2021-07-15 13:51:32 +08:00
CHANGELOG.md.meta feat(*): update namespace to TapTap.ModuleName 2021-04-07 16:20:41 +08:00
Documentation.meta feat(tapdb): add dynamicProperties interface 2021-04-14 13:46:30 +08:00
Plugins.meta mod:replace all framework 2021-04-08 10:11:23 +08:00
README.md doc: TDSUser 2021-07-15 06:04:16 +00:00
README.md.meta feat(*): update namespace to TapTap.ModuleName 2021-04-07 16:20:41 +08:00
VERSIONNOTE.md Merge branch 'develop/2.x' into feat/tdsuser 2021-07-15 11:49:07 +08:00
VERSIONNOTE.md.meta feat: update release native binary 2021-06-10 11:12:59 +08:00
package.json feat: update Bootstrap and Login changeLog 2021-07-15 13:51:32 +08:00
package.json.meta feat(*): update namespace to TapTap.ModuleName 2021-04-07 16:20:41 +08:00

README.md

使用 TapTap.Bootstrap

使用前提

使用 TapTap.Bootstrap 前提是必须依赖以下库:

命名空间

using TapTap.Bootstrap;

接口描述

1.初始化

TapBootstrap 会根据 TapConfig 中的 TapDBConfig 配置来进行 TapDB 的自动初始化。

开启 TapDB
var config = new TapConfig.TapConfigBuilder()
                .ClientID("client_id")
                .ClientSecret("client_secret")
                .ServerURL("https://ikggdre2.lc-cn-n1-shared.com")
                .RegionType(RegionType.CN)
                .TapDBConfig(true,"channel","gameVersion",true)
                .Builder();
关闭 TapDB
var config = new TapConfig.TapConfigBuilder()
                .ClientID("client_id")
                .ClientSecret("client_secret")
                .ServerURL("https://ikggdre2.lc-cn-n1-shared.com")
                .RegionType(RegionType.CN)
//#             .TapDBConfig(false,null,null,false)
                .EnableTapDB(false)
                .Builder();
初始化
TapBootstrap.Init(config);

2.账户系统

登陆成功之后,都会得到一个 TDSUser 实例

使用 TapTap OAuth 授权结果直接登陆/注册账户系统

var tdsUser = await TDSUser.LoginWithTapTap();

游客登陆

var tdsUser = await TDSUser.LoginAnonymously();

使用第三方平台授权登录/注册账户

var tdsUser = await TDSUser.LoginWithAuthData(Dictionary<string, object> authData, string platform,
            LCUserAuthDataLoginOption option = null);

绑定第三方平台授权

await TDSUser.AssociateAuthData(Dictionary<string, object> authData, string platform);

退出登陆

TDSUser.Logout();