feat (bootstrap) : update TapConfig constructor func

docs : update doc
xiaoyi 2021-04-25 15:45:36 +08:00
parent e8bd17c618
commit f592c8cdfe
7 changed files with 29 additions and 34 deletions

View File

@ -4,27 +4,28 @@
### Feature ### Feature
* 新增篝火测试资格 * 新增篝火测试资格
``` ```
Bootstrap.GetTestQualification(bool,tapError=>{}): Bootstrap.GetTestQualification((bool, error)=>{ }):
``` ```
* TapDB 通过 TapConfig 进行自动初始化 * TapDB 通过 TapConfig 进行自动初始化
* 支持性改动用于 TapTap.Friends * 支持性改动用于 TapTap.Friends
### Breaking changes ### Breaking changes
* 废弃 Bind 接口
* LoginType 删除 Apple、Guest 登陆方式 * LoginType 删除 Apple、Guest 登陆方式
* TDS-Info.plist 删除 Apple_SignIn_Enable 配置
* 废弃 Bind 接口
* TapConfig Refactor Constructor * TapConfig Refactor Constructor
```c# ```c#
//建议使用以下 TapConfig 构造方法进行初始化 //建议使用以下 TapConfig 构造方法进行初始化
var config = new TapConfig.TapConfigBuilder() var config = new TapConfig.TapConfigBuilder()
.ClientID("client_id") .ClientID("client_id")
.ClientSecrect("client_secret") .ClientSecret("client_secret")
.RegionType(RegionType.CN) .RegionType(RegionType.CN)
.TapDBConfig("channel", "gameVersion")
.Builder(); .Builder();
TapBootstrap.Init(config);
Bootstrap.Init(config);
``` ```
### Dependencies ### Dependencies

View File

@ -16,7 +16,13 @@ using TapTap.Bootstrap;
### 初始化 ### 初始化
```c# ```c#
TapConfig config = new TapConfig(string clientId,bool isCN); var config = new TapConfig.TapConfigBuilder()
.ClientID("client_id")
.ClientSecret("client_secret")
.RegionType(RegionType.CN)
.TapDBConfig("channel", "gameVersion")
.Builder();
TapBootstrap.Init(config); TapBootstrap.Init(config);
``` ```

View File

@ -36,8 +36,6 @@ namespace TapTap.Bootstrap.Editor
TapCommonCompile.HandlerPlist(path, plistFile.FullName); TapCommonCompile.HandlerPlist(path, plistFile.FullName);
HandlerAppleSignIn(proj, target, path, plistFile.FullName);
if (TapCommonCompile.HandlerIOSSetting(path, if (TapCommonCompile.HandlerIOSSetting(path,
Application.dataPath, Application.dataPath,
"TapBootstrapResource", "TapBootstrapResource",
@ -53,26 +51,5 @@ namespace TapTap.Bootstrap.Editor
Debug.LogWarning("TapBootstrap add Bundle Failed!"); Debug.LogWarning("TapBootstrap add Bundle Failed!");
} }
private static void HandlerAppleSignIn(PBXProject proj, string target, string path, string plistPath)
{
var appleSignInEnable = TapCommonCompile.GetValueFromPlist(plistPath, "Apple_SignIn_Enable");
var appleSignInEnableKey = "com.apple.developer.applesignin";
if (string.IsNullOrEmpty(appleSignInEnable) || appleSignInEnable.Equals("false"))
{
Debug.LogWarning("TapSDK can't open Apple SignIn in XCode, Please Check Info.plist.");
return;
}
var entitleFilePath = $"{path}/Unity-iPhone.entitlements";
var tempEntitlements = new PlistDocument();
if (!((tempEntitlements.root[appleSignInEnableKey] = new PlistElementArray()) is PlistElementArray arrSigninWithApple))
{
Debug.LogWarning($"TapSDK can't find {appleSignInEnableKey}.");
return;
}
arrSigninWithApple.values.Add(new PlistElementString("Default"));
proj.AddCapability(target, PBXCapabilityType.SignInWithApple, entitleFilePath);
tempEntitlements.WriteToFile(entitleFilePath);
}
} }
} }

Binary file not shown.

Binary file not shown.

View File

@ -16,7 +16,13 @@ using TapTap.Bootstrap;
### 初始化 ### 初始化
```c# ```c#
TapConfig config = new TapConfig(string clientId,bool isCN); var config = new TapConfig.TapConfigBuilder()
.ClientID("client_id")
.ClientSecret("client_secret")
.RegionType(RegionType.CN)
.TapDBConfig("channel", "gameVersion")
.Builder();
TapBootstrap.Init(config); TapBootstrap.Init(config);
``` ```
@ -57,6 +63,11 @@ TapBootstrap.GetUser(Action<TapUser,TapError> action);
TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action); TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action);
``` ```
### 篝火测试资格
```c#
TapBootstrap.GetTestQualification(Action<bool,TapError> action);
```
### 获取AccessToken ### 获取AccessToken
```c# ```c#
TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action); TapBootstrap.GetDetailUser(Action<TapUserDetail, TapError> action);