feat:update upm
commit
f7a5f18227
|
@ -0,0 +1,222 @@
|
|||
# ChangeLog
|
||||
|
||||
## 3.13.0
|
||||
### Fixed Bugs
|
||||
- Android & iOS: 支持新的 scope (basic_info & email)
|
||||
- Android: 修复一些情况下的错误崩溃
|
||||
- iOS: 支持更安全的有端授权协议
|
||||
|
||||
## 3.11.1
|
||||
|
||||
### Fixed Bugs
|
||||
- iOS: 修复登录模块对系统 URL 回调的使用方式
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.11.1
|
||||
|
||||
## 3.11.0
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.11.0
|
||||
|
||||
## 3.10.0
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.10.0
|
||||
|
||||
## 3.9.0
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.9.0
|
||||
|
||||
## 3.8.0
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.8.0
|
||||
|
||||
## 3.7.1
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.7.1
|
||||
|
||||
## 3.7.0
|
||||
|
||||
### Optimization and fixed bugs
|
||||
- 添加获取互关列表接口
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.7.0
|
||||
|
||||
|
||||
## 3.6.3
|
||||
|
||||
### Optimization and fixed bugs
|
||||
- Android 尝试修复静态变量丢失的问题
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.6.3
|
||||
|
||||
## 3.6.1
|
||||
|
||||
### Optimization and fixed bugs
|
||||
- UI 优化
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.6.1
|
||||
|
||||
## 3.6.0
|
||||
|
||||
### Optimization and fixed bugs
|
||||
|
||||
- 优化未安装 iOS Support 时 Editor 编译问题
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.6.0
|
||||
|
||||
## 3.5.2
|
||||
|
||||
### New Feature
|
||||
|
||||
- 新增 PC Web 授权登录
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.5.2
|
||||
|
||||
## 3.5.0
|
||||
|
||||
### Optimization and fixed bugs
|
||||
- 内嵌 web 登录页面支持异形刘海屏的正常展示
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.5.0
|
||||
|
||||
## 3.4.0
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.4.0
|
||||
|
||||
## 3.3.0
|
||||
|
||||
### Optimization and fixed bugs
|
||||
|
||||
- 优化 iOS Plist.info 修改方式,防止覆盖工程原有配置。
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.3.0
|
||||
|
||||
## 3.2.1
|
||||
|
||||
### New Feature
|
||||
|
||||
- 新增 TapTap 登录权限配置范围
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.2.0
|
||||
|
||||
## 3.2.0
|
||||
|
||||
### New Feature
|
||||
|
||||
- 支持 PC 端使用 TapTap 登录
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.2.0
|
||||
|
||||
## 3.1.0
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.1.0
|
||||
|
||||
## 3.0.0
|
||||
|
||||
### New Feature
|
||||
|
||||
- 新增 TapTap OAuth 相关接口
|
||||
```
|
||||
// 登陆
|
||||
TapLogin.Login();
|
||||
// 登出
|
||||
TapLogin.Logout();
|
||||
```
|
||||
- 新增篝火测试资格
|
||||
```
|
||||
var boolean = await TapLogin.GetTestQualification();
|
||||
```
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v3.0.0
|
||||
|
||||
## 2.1.7
|
||||
|
||||
### Optimization
|
||||
|
||||
- 更新 iOS 拦截 openUrl 方式
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v2.1.7
|
||||
|
||||
### 2.1.6
|
||||
|
||||
### Optimization and fixed bugs
|
||||
|
||||
- 修复 TapTap 授权登录的一些 UI 问题
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v2.1.6
|
||||
|
||||
### 2.1.5
|
||||
|
||||
### New Feature
|
||||
|
||||
- 云玩内唤起 TapTap 客户端登陆
|
||||
|
||||
### 2.1.4
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v2.1.4
|
||||
|
||||
### 2.1.3
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v2.1.3
|
||||
|
||||
### 2.1.2
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v2.1.2
|
||||
|
||||
## 2.1.1
|
||||
|
||||
### Dependencies
|
||||
|
||||
- TapTap.Common v2.1.1
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Feature
|
||||
|
||||
* TapTap Login
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eeb07bf1995f44e02bf1e2f6c996794c
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f2c93960c5ec14a968e71901b4eaeaab
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,58 @@
|
|||
## TapTap.Login
|
||||
|
||||
## 使用前提
|
||||
|
||||
使用 TapTap.Login 前提是必须依赖以下库:
|
||||
|
||||
* [TapTap.Common](https://github.com/TapTap/TapCommon-Unity.git)
|
||||
|
||||
> 如果游戏需要支持 PC 平台 ,则参考[ PC配置文档 ](PC.md)
|
||||
|
||||
### 1.初始化
|
||||
|
||||
#### 如果配合 `TapBoostrap` 使用,则不需要调用初始化接口
|
||||
|
||||
```c#
|
||||
TapLogin.Init(string clientID);
|
||||
```
|
||||
|
||||
### 2.唤起 TapTap 网页 或者 TapTap 客户端进行登陆
|
||||
|
||||
登陆成功之后,会返回 `AccessToken`
|
||||
|
||||
```c#
|
||||
var accessToken = await TapLogin.Login();
|
||||
```
|
||||
|
||||
配置权限范围
|
||||
|
||||
```c#
|
||||
// 默认使用 public_profile
|
||||
|
||||
var accessToken = await TapLogin.Login(new []{"public_profile"})
|
||||
;
|
||||
```
|
||||
|
||||
### 3. 获取 TapTap AccessToken
|
||||
|
||||
```c#
|
||||
var accessToken = await TapLogin.GetAccessToken();
|
||||
```
|
||||
|
||||
### 4. 获取 TapTap Profile
|
||||
|
||||
```c#
|
||||
var profile = await TapLogin.FetchProfile();
|
||||
```
|
||||
|
||||
### 5. 获取篝火测试资格
|
||||
|
||||
```c#
|
||||
var boolean = await TapLogin.GetTestQualification();
|
||||
```
|
||||
|
||||
### 6. 退出登陆
|
||||
|
||||
```c#
|
||||
TapLogin.Logout();
|
||||
```
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bba3a05fa298643d1a20c3cab5614c17
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b342e9aa171b743c5996484a958afba5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6b459e69a01b34fc29e293ebc89f27f6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,67 @@
|
|||
using System.IO;
|
||||
using TapTap.Common.Editor;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
#if UNITY_IOS || UNITY_STANDALONE_OSX
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
|
||||
namespace TapTap.Login.Editor
|
||||
{
|
||||
#if UNITY_IOS || UNITY_STANDALONE_OSX
|
||||
public static class TapLoginIOSProcessor
|
||||
{
|
||||
// 添加标签,unity导出工程后自动执行该函数
|
||||
[PostProcessBuild(103)]
|
||||
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
||||
{
|
||||
var parentFolder = Directory.GetParent(Application.dataPath)?.FullName;
|
||||
|
||||
var plistFile = TapFileHelper.RecursionFilterFile(parentFolder + "/Assets/Plugins/", "TDS-Info.plist");
|
||||
|
||||
if (!plistFile.Exists)
|
||||
{
|
||||
Debug.LogError("TapSDK Can't find TDS-Info.plist in Project/Assets/Plugins/!");
|
||||
}
|
||||
|
||||
|
||||
if (buildTarget is BuildTarget.iOS)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
TapCommonCompile.HandlerPlist(Path.GetFullPath(path), plistFile.FullName);
|
||||
#endif
|
||||
}
|
||||
else if (buildTarget is BuildTarget.StandaloneOSX)
|
||||
{
|
||||
Debug.Log($"path:{path}");
|
||||
Debug.Log($"path:{Path.GetFullPath(path)}");
|
||||
Debug.Log($"dir:{Path.GetDirectoryName(path)}");
|
||||
Debug.Log($"dir:{Path.GetFileName(path)}");
|
||||
// 获得工程路径
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
var directory = Path.GetDirectoryName(path);
|
||||
if (string.IsNullOrEmpty(directory))
|
||||
{
|
||||
directory = "";
|
||||
}
|
||||
|
||||
var fileName = Path.GetFileName(path);
|
||||
if (!fileName.EndsWith(".xcodeproj"))
|
||||
{
|
||||
fileName += ".xcodeproj";
|
||||
}
|
||||
|
||||
var projPath = Path.Combine(directory, $"{fileName}/project.pbxproj");
|
||||
#elif UNITY_2019_1_OR_NEWER
|
||||
var projPath = Path.Combine(path, "project.pbxproj");
|
||||
#else
|
||||
#endif
|
||||
#if UNITY_IOS
|
||||
TapCommonCompile.HandlerPlist(Path.GetFullPath(path), plistFile.FullName, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 543a4c42d7c774f1cb7a7b18b19c6c5f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using TapTap.Common.Editor;
|
||||
|
||||
namespace TapTap.Login.Mobile.Editor {
|
||||
public class TapLoginMobileProcessBuild : SDKLinkProcessBuild {
|
||||
public override int callbackOrder => 0;
|
||||
|
||||
public override string LinkPath => "TapTap/Login/link.xml";
|
||||
|
||||
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
||||
new LinkedAssembly { Fullname = "TapTap.Login.Runtime" },
|
||||
new LinkedAssembly { Fullname = "TapTap.Login.Mobile.Runtime" }
|
||||
};
|
||||
|
||||
public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
|
||||
return BuildTargetUtils.IsSupportMobile(report.summary.platform);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fa860a43f603e4d569a2efe38e2760d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "TapTap.Login.Mobile.Editor",
|
||||
"references": [
|
||||
"GUID:616cea76def2d4f059b94440fc8cc03d"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 60aa8897230d6419da34689f63383ebd
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8126ac1a2c05c468581fbae88a51caad
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,46 @@
|
|||
using System.Threading.Tasks;
|
||||
using TapTap.Common;
|
||||
|
||||
namespace TapTap.Login.Mobile
|
||||
{
|
||||
public interface ITapLogin
|
||||
{
|
||||
void Init(string clientID);
|
||||
|
||||
void Init(string clientID, bool isCn, bool roundCorner);
|
||||
|
||||
void ChangeConfig(bool roundCorner, bool isPortrait);
|
||||
|
||||
Task<Profile> FetchProfile();
|
||||
|
||||
Task<Profile> GetProfile();
|
||||
|
||||
Task<AccessToken> GetAccessToken();
|
||||
|
||||
Task<AccessToken> Login();
|
||||
|
||||
Task<AccessToken> Login(string[] permissions);
|
||||
|
||||
Task<bool> GetTestQualification();
|
||||
|
||||
void Logout();
|
||||
}
|
||||
|
||||
public interface ITapLoginResultListener
|
||||
{
|
||||
void LoginCancel();
|
||||
|
||||
void LoginError(TapError error);
|
||||
|
||||
void LoginSuccess(AccessToken token);
|
||||
}
|
||||
|
||||
public static class TapLoginConstants
|
||||
{
|
||||
public static string TAP_LOGIN_SERVICE = "TDSLoginService";
|
||||
|
||||
public static string TAP_LOGIN_SERVICE_CLZ = "com.taptap.sdk.wrapper.TDSLoginService";
|
||||
|
||||
public static string TAP_LOGIN_SERVICE_IMPL = "com.taptap.sdk.wrapper.TDSLoginServiceImpl";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 69b41de145ee74f908e40d3c44ff7b6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,242 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TapTap.Common;
|
||||
|
||||
namespace TapTap.Login.Mobile
|
||||
{
|
||||
public class TapLoginImpl : ITapLogin
|
||||
{
|
||||
private TapLoginImpl()
|
||||
{
|
||||
EngineBridge.GetInstance()
|
||||
.Register(TapLoginConstants.TAP_LOGIN_SERVICE_CLZ, TapLoginConstants.TAP_LOGIN_SERVICE_IMPL);
|
||||
}
|
||||
|
||||
private static volatile TapLoginImpl _sInstance;
|
||||
|
||||
private static readonly object Locker = new object();
|
||||
|
||||
public static TapLoginImpl GetInstance()
|
||||
{
|
||||
lock (Locker)
|
||||
{
|
||||
if (_sInstance == null)
|
||||
{
|
||||
_sInstance = new TapLoginImpl();
|
||||
}
|
||||
}
|
||||
|
||||
return _sInstance;
|
||||
}
|
||||
|
||||
public void Init(string clientID)
|
||||
{
|
||||
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("init")
|
||||
.Args("clientID", clientID)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void Init(string clientID, bool isCn, bool roundCorner)
|
||||
{
|
||||
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("initWithClientID")
|
||||
.Args("clientID", clientID)
|
||||
.Args("regionType", isCn)
|
||||
.Args("roundCorner", roundCorner)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
public void ChangeConfig(bool roundCorner, bool isPortrait)
|
||||
{
|
||||
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("changeConfig")
|
||||
.Args("roundCorner", roundCorner)
|
||||
.Args("isPortrait", isPortrait)
|
||||
.CommandBuilder());
|
||||
}
|
||||
|
||||
|
||||
public async Task<Profile> FetchProfile()
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("fetchProfileForCurrentAccessToken")
|
||||
.Callback(true)
|
||||
.OnceTime(true)
|
||||
.CommandBuilder();
|
||||
var result = await EngineBridge.GetInstance().Emit(command);
|
||||
if (!EngineBridge.CheckResult(result))
|
||||
{
|
||||
throw new TapException((int)TapErrorCode.ERROR_CODE_BRIDGE_EXECUTE, "TapSDK fetchProfile Failed!");
|
||||
}
|
||||
|
||||
var loginWrapper = new TapLoginWrapper(result.content);
|
||||
if (loginWrapper.LoginCallbackCode == 0)
|
||||
{
|
||||
return new Profile(loginWrapper.Wrapper);
|
||||
}
|
||||
|
||||
throw new TapException((int)TapErrorCode.ERROR_CODE_BRIDGE_EXECUTE, loginWrapper.Wrapper);
|
||||
}
|
||||
|
||||
public async Task<Profile> GetProfile()
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("currentProfile")
|
||||
.Callback(true)
|
||||
.OnceTime(true)
|
||||
.CommandBuilder();
|
||||
var result = await EngineBridge.GetInstance().Emit(command);
|
||||
if (!EngineBridge.CheckResult(result))
|
||||
{
|
||||
throw new TapException((int)TapErrorCode.ERROR_CODE_BRIDGE_EXECUTE, "TapSDK GetProfile Failed!");
|
||||
}
|
||||
|
||||
return new Profile(result.content);
|
||||
}
|
||||
|
||||
public async Task<AccessToken> GetAccessToken()
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("currentAccessToken")
|
||||
.Callback(true)
|
||||
.OnceTime(true)
|
||||
.CommandBuilder();
|
||||
|
||||
var result = await EngineBridge.GetInstance().Emit(command);
|
||||
|
||||
if (!EngineBridge.CheckResult(result))
|
||||
{
|
||||
throw new TapException((int)TapErrorCode.ERROR_CODE_BRIDGE_EXECUTE, "TapSDK GetAccessToken Failed!");
|
||||
}
|
||||
|
||||
return new AccessToken(result.content);
|
||||
}
|
||||
|
||||
public void AppendPermission(string permission) {
|
||||
// TODO@luran
|
||||
// var command = new Command.Builder()
|
||||
// .Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
// .Method("appendPermission")
|
||||
// .Args("permission", permission)
|
||||
// .CommandBuilder();
|
||||
|
||||
// EngineBridge.GetInstance().CallHandler(command);
|
||||
}
|
||||
|
||||
public async Task<AccessToken> Login()
|
||||
{
|
||||
var tcs = new TaskCompletionSource<AccessToken>();
|
||||
RegisterLoginCallback(tcs);
|
||||
StartLogin(new[] { TapLogin.TAP_LOGIN_SCOPE_PUBLIC_PROFILE });
|
||||
return await tcs.Task;
|
||||
}
|
||||
|
||||
public async Task<AccessToken> Login(string[] permissions)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<AccessToken>();
|
||||
RegisterLoginCallback(tcs);
|
||||
StartLogin(permissions);
|
||||
return await tcs.Task;
|
||||
}
|
||||
|
||||
public void Logout()
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("logout")
|
||||
.CommandBuilder();
|
||||
|
||||
EngineBridge.GetInstance().CallHandler(command);
|
||||
}
|
||||
|
||||
public async Task<bool> GetTestQualification()
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("getTestQualification")
|
||||
.Callback(true)
|
||||
.OnceTime(true)
|
||||
.CommandBuilder();
|
||||
|
||||
var result = await EngineBridge.GetInstance().Emit(command);
|
||||
|
||||
if (!EngineBridge.CheckResult(result))
|
||||
{
|
||||
throw new TapException((int)TapErrorCode.ERROR_CODE_BRIDGE_EXECUTE,
|
||||
"TapSDK GetTestQualification Failed!");
|
||||
}
|
||||
|
||||
var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
|
||||
var testQualification = SafeDictionary.GetValue<int>(dic, "userTestQualification");
|
||||
return testQualification == 1;
|
||||
}
|
||||
|
||||
private static void StartLogin(string[] permissions)
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("startTapLogin")
|
||||
.Args("permissions", permissions)
|
||||
.CommandBuilder();
|
||||
EngineBridge.GetInstance().CallHandler(command);
|
||||
}
|
||||
|
||||
|
||||
private static void RegisterLoginCallback(TaskCompletionSource<AccessToken> tcs)
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("registerLoginCallback")
|
||||
.Callback(true)
|
||||
.OnceTime(false)
|
||||
.CommandBuilder();
|
||||
|
||||
EngineBridge.GetInstance().CallHandler(command, result =>
|
||||
{
|
||||
if (!EngineBridge.CheckResult(result))
|
||||
{
|
||||
tcs.TrySetException(new TapException((int)TapErrorCode.ERROR_CODE_BRIDGE_EXECUTE,
|
||||
"TapSDK Login Failed!"));
|
||||
return;
|
||||
}
|
||||
|
||||
var wrapper = new TapLoginWrapper(result.content);
|
||||
|
||||
switch (wrapper.LoginCallbackCode)
|
||||
{
|
||||
case 0:
|
||||
var accessToken = new AccessToken(wrapper.Wrapper);
|
||||
tcs.TrySetResult(accessToken);
|
||||
break;
|
||||
case 1:
|
||||
tcs.TrySetException(new TapException((int)TapErrorCode.ERROR_CODE_BIND_CANCEL,
|
||||
"Login Cancel"));
|
||||
break;
|
||||
default:
|
||||
var tapError = TapError.SafeConstructorTapError(wrapper.Wrapper);
|
||||
tcs.TrySetException(new TapException(tapError.code,
|
||||
tapError.errorDescription));
|
||||
break;
|
||||
}
|
||||
|
||||
UnRegisterLoginCallback();
|
||||
});
|
||||
}
|
||||
|
||||
private static void UnRegisterLoginCallback()
|
||||
{
|
||||
var command = new Command.Builder()
|
||||
.Service(TapLoginConstants.TAP_LOGIN_SERVICE)
|
||||
.Method("unregisterLoginCallback")
|
||||
.CommandBuilder();
|
||||
EngineBridge.GetInstance().CallHandler(command);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6a4684c9ef1d943ffba49b2e8d38906c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,70 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TapTap.Login.Mobile
|
||||
{
|
||||
public class TapLoginMobile : Internal.ITapLoginPlatform
|
||||
{
|
||||
public void Init(string clientID)
|
||||
{
|
||||
TapLoginImpl.GetInstance().Init(clientID);
|
||||
}
|
||||
|
||||
public void Init(string clientID, bool isCn, bool roundCorner)
|
||||
{
|
||||
TapLoginImpl.GetInstance().Init(clientID, isCn, roundCorner);
|
||||
}
|
||||
|
||||
public void ChangeConfig(bool roundCorner, bool isPortrait)
|
||||
{
|
||||
TapLoginImpl.GetInstance().ChangeConfig(roundCorner, isPortrait);
|
||||
}
|
||||
|
||||
public Task<Profile> FetchProfile()
|
||||
{
|
||||
return TapLoginImpl.GetInstance().FetchProfile();
|
||||
}
|
||||
|
||||
public Task<Profile> GetProfile()
|
||||
{
|
||||
return TapLoginImpl.GetInstance().GetProfile();
|
||||
}
|
||||
|
||||
public Task<AccessToken> GetAccessToken()
|
||||
{
|
||||
return TapLoginImpl.GetInstance().GetAccessToken();
|
||||
}
|
||||
|
||||
public void AppendPermission(string permission) {
|
||||
TapLoginImpl.GetInstance().AppendPermission(permission);
|
||||
}
|
||||
|
||||
public Task<AccessToken> Login()
|
||||
{
|
||||
return TapLoginImpl.GetInstance().Login();
|
||||
}
|
||||
|
||||
public Task<AccessToken> Login(string[] permissions)
|
||||
{
|
||||
return TapLoginImpl.GetInstance().Login(permissions);
|
||||
}
|
||||
|
||||
public Task<AccessToken> Authorize(string[] permissions = null) {
|
||||
throw new NotImplementedException(nameof(Authorize));
|
||||
}
|
||||
|
||||
public async Task<AccessToken> Login(TapLoginPermissionConfig _) {
|
||||
throw new NotImplementedException(nameof(Login));
|
||||
}
|
||||
|
||||
public void Logout()
|
||||
{
|
||||
TapLoginImpl.GetInstance().Logout();
|
||||
}
|
||||
|
||||
public Task<bool> GetTestQualification()
|
||||
{
|
||||
return TapLoginImpl.GetInstance().GetTestQualification();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4295ff79f49ab4cd6a6d8895c03abb78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,19 @@
|
|||
using System.Collections.Generic;
|
||||
using TapTap.Common;
|
||||
|
||||
namespace TapTap.Login.Mobile
|
||||
{
|
||||
public class TapLoginWrapper
|
||||
{
|
||||
public string Wrapper;
|
||||
|
||||
public int LoginCallbackCode;
|
||||
|
||||
public TapLoginWrapper(string json)
|
||||
{
|
||||
var dic = Json.Deserialize(json) as Dictionary<string, object>;
|
||||
Wrapper = SafeDictionary.GetValue<string>(dic, "wrapper");
|
||||
LoginCallbackCode = SafeDictionary.GetValue<int>(dic, "loginCallbackCode");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 13f1c9f969a6c45ad906faf33c39c76e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "TapTap.Login.Mobile.Runtime",
|
||||
"references": [
|
||||
"GUID:e8754b6153389406c963cd52996cc80f",
|
||||
"GUID:0b3f64ec33f5b4da98a17367a35b82f2",
|
||||
"GUID:43c632eee0a6f42cdaf21080b154f3a1"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Android",
|
||||
"iOS"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ff51c32c188e424b97bac52a5cb5184
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,60 @@
|
|||
# TapTap Login PC 登录接入文档
|
||||
|
||||
> TapTap.Login PC 支持 Window 以及 Mac 两种平台,提供 Web 浏览器授权以及 TapTap 客户端扫码登录
|
||||
|
||||
|
||||
## 在 Mac 平台使用 TapTap.Login
|
||||
|
||||
### 1. 编译配置
|
||||
|
||||
* 打开 *BuildSetting* 选择 *PC、Mac & Linux Standalone* Platform,*Target Platform* 选择 MacOS
|
||||
* 勾选 *Create XCode Project* ,选择输出 XCode 工程进行编译
|
||||
|
||||
### 2. 配置 URL Types
|
||||
|
||||
* 打开输出的 *XCode Project* , 选择 *Target* ,点击 *Info* ,展开 *URL Types*,请检查是否自动添加以下 URL Scheme,如果未添加,则手动添加进去。
|
||||
> TapWeb : open-taptap-{clientId}
|
||||
|
||||
* 或者修改 *Info.plist* ,添加以下配置
|
||||
|
||||
```xml
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>TapWeb</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>open-taptap-{client_id}</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
```
|
||||
|
||||
## 在 Window 平台使用 TapTap.Login
|
||||
|
||||
#### 给 Window 添加游戏注册表
|
||||
|
||||
```
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CLASSES_ROOT\open-taptap-{client_id}]
|
||||
@="{游戏名称}"
|
||||
"URL Protocol"="{程序.exe 安装路径}}"
|
||||
|
||||
[HKEY_CLASSES_ROOT\open-taptap-{client_id}]
|
||||
@="{游戏名称}"
|
||||
|
||||
[HKEY_CLASSES_ROOT\open-taptap-{client_id}]
|
||||
|
||||
[HKEY_CLASSES_ROOT\open-taptap-{client_id}\Shell\Open]
|
||||
|
||||
[HKEY_CLASSES_ROOT\open-taptap-{client_id}\Shell\Open\Command]
|
||||
@="\"{程序.exe 安装路径}\" \"%1\""
|
||||
|
||||
```
|
||||
|
||||
打开 Window 注册表编辑器,查看 `HKEY_CLASSES_ROOT\open-taptap-{clientId}` 是否存在以及等该目录下是否包含 `DefaultIcon`、`Shell\Open\Command` 是否匹配上文中的参数
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0acb126baaec47058c09c039fb0df359
|
||||
timeCreated: 1639126466
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 389763214cb6d491d83a645bbf33a750
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b872f00946c04ccea41c19eb6ae406a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0ef9a962e4bd24262a889ea13fed9c07
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
|
@ -0,0 +1,32 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5430ffeec07c64c70a24cbccf10427ea
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 667a75a1a23fe417c89c8e75fdba321b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 309e7468770854d07a38ca51ef1829e6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,81 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 784e57f7c38f14328a4a9f152e87d7b5
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
CPU: AnyCPU
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b5e91d6bad9f4090a2dc5bf614900c7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9d242cca9140d40d78d40c9b0ba42f83
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b5bf530788c54a0c98f3f119ffe018f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "Logged-in account: %@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d2eb1f0be90124e68bef90717f655064
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ca331e26308524b2cb6ac3d94892adfd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ac4a0c657b59f47eaad6dc8ff6e96019
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ab3bca347acf434db5e39ef22bbc892
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: da7dff583a65f47f9973b2481cb7226e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fb1b23f99dc064baab3b199feeae7d25
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "Akun yang login: %@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 43e252b114f854419baf400183208b50
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 983e1a5c5b85c44ffa75c31450606cd8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "ログイン中のアカウント: %@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b4661d3b83ad041d790c846447758435
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bef30948d02b54274983dbefded33ec6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "로그인한 계정: %@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 29c3c4bb5a7bf415cb93932414adc6e1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5ebb76afb1c8e492eb8949cf184a7a94
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e275839cd7f748e6846fad0ad64b3c2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ead7a39da21054216bbf6072b8871f05
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "Conta conectada: %@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 11f5d3b65ca6746e0b3d076242acdd47
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e050e70b0b4e04264a21513eb5c5c362
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 94a531815737844a78f2ce3e689c09a3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e6a8d0f28f4c64190815ffbf9e2c09e6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "บัญชีที่ล็อกอิน: %@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cdeaf15b417c74245be161daa2200b67
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 371c43faa9bb443a788487cd6430d935
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2a1d4b63d9fe1438383845395288c405
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7202dbeb7c376497fb59b8462b254016
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 768feb47ba3b84322a37871a6932a898
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c62cd238649743bca30a3ab7c04b4b8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "已登录账号:%@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e9df5fbec9b7845ed9517866777fa862
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fcda00af308b449da8707e7bdf706754
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
"login_account_logged_tip" = "已登入帳號:%@";
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c65596cb45cb7409296edcff7b73de7a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,69 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0cb5e9195d4db4ef29b7f5c2c756f40e
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: abeb3e307f861456eb7b2d4f36aaff3a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// AccountGlobalError.h
|
||||
// TapTapLoginSource
|
||||
//
|
||||
// Created by Bottle K on 2020/12/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
FOUNDATION_EXPORT NSString *const LOGIN_ERROR_ACCESS_DENIED;
|
||||
FOUNDATION_EXPORT NSString *const LOGIN_ERROR_INVALID_GRANT;
|
||||
FOUNDATION_EXPORT NSString *const LOGIN_ERROR_PERMISSION_RESULT;
|
||||
|
||||
@interface AccountGlobalError : NSObject
|
||||
@property (nonatomic, assign) NSInteger code;
|
||||
@property (nonatomic, copy) NSString *msg;
|
||||
@property (nonatomic, copy) NSString *error;
|
||||
@property (nonatomic, copy) NSString *errorDescription;
|
||||
|
||||
- (instancetype)initWithName:(NSString *)errorName NSError:(NSError *)error;
|
||||
|
||||
- (NSString *)toJsonString;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c815f3cc598254d3c9c4cf1f947c5e43
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// IscTapLoginService.h
|
||||
// Pods-TDSLoginSource_Example
|
||||
//
|
||||
// Created by Bottle K on 2020/12/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <TapLoginSDK/TapLoginSDK.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface IscTapLoginService : NSObject
|
||||
+ (void)addSDKLoginResultDelegate:(NSString *)sdkName delegate:(id <TapTapLoginResultDelegate>)delegate;
|
||||
|
||||
+ (void)removeSDKLoginResultDelegate:(NSString *)sdkName;
|
||||
|
||||
+ (void)startSDKLogin:(NSString *)sdkName permission:(NSArray *)permissions;
|
||||
|
||||
+ (void)handleLoginError:(NSDictionary *)params;
|
||||
|
||||
+ (void)changeConfigWithClientId:(NSString *)clientId
|
||||
regionType:(RegionType)region
|
||||
token:(TTSDKAccessToken *)token;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3f071f3c86c054828b1233d42d24acb2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,69 @@
|
|||
//
|
||||
// TTSDKAccessToken.h
|
||||
// TapTapSDK
|
||||
//
|
||||
// Created by TapTap on 2017/10/17.
|
||||
// Copyright © 2017年 易玩. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* @brief TapTap登录授权数据封装类
|
||||
*
|
||||
* 该类封装了所有授权提供的返回数据
|
||||
*/
|
||||
@interface TTSDKAccessToken : NSObject
|
||||
|
||||
/// 唯一标志
|
||||
@property (nonatomic, copy) NSString * kid;
|
||||
|
||||
/// 认证码
|
||||
@property (nonatomic, copy) NSString * accessToken;
|
||||
|
||||
/// 认证码类型
|
||||
@property (nonatomic, copy) NSString * tokenType;
|
||||
|
||||
/// mac密钥
|
||||
@property (nonatomic, copy) NSString * macKey;
|
||||
|
||||
/// mac密钥计算方式
|
||||
@property (nonatomic, copy) NSString * macAlgorithm;
|
||||
|
||||
/// 用户授权的权限,多个时以逗号隔开
|
||||
@property (nonatomic, copy) NSString * scope;
|
||||
|
||||
/// 用户授权的权限 Array 形式
|
||||
@property (nonatomic, copy) NSArray<NSString *> * scopeArray;
|
||||
|
||||
/// 根据JSON生成 TTSDKAccessToken
|
||||
/// @param accessTokenJsonString json字符串类型的AccessToken
|
||||
+ (TTSDKAccessToken *)build:(NSString *)accessTokenJsonString;
|
||||
|
||||
/// 通过参数生成实例
|
||||
+ (TTSDKAccessToken *)build:(NSString *)kid accessToken:(NSString *)accessToken tokenType:(NSString *)tokenType macKey:(NSString *)macKey macAlgorithm:(NSString *)macAlgorithm;
|
||||
|
||||
+ (TTSDKAccessToken *)build:(NSString *)kid accessToken:(NSString *)accessToken tokenType:(NSString *)tokenType macKey:(NSString *)macKey macAlgorithm:(NSString *)macAlgorithm scope:(NSArray *)scope;
|
||||
|
||||
/// 转换成json字符串
|
||||
- (NSString *)toJsonString;
|
||||
|
||||
- (NSDictionary *)toDictionary;
|
||||
|
||||
+ (NSArray *)scopeStringToArray:(NSString *)scopeString;
|
||||
|
||||
+ (TTSDKAccessToken *)createWithQueryStr:(NSString *)queryStr;
|
||||
+ (TTSDKAccessToken *)createWithDictionary:(NSDictionary *)dic;
|
||||
|
||||
- (NSString *)toQueryString;
|
||||
|
||||
/**
|
||||
* @brief 获取当前认证
|
||||
*
|
||||
* 该认证会优先读取本地缓存,不存在时将会返回nil
|
||||
*/
|
||||
+ (TTSDKAccessToken *)currentAccessToken;
|
||||
|
||||
+ (void)setCurrentToken:(TTSDKAccessToken *)token;
|
||||
|
||||
@end
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 876cdb492e7fe44db98e22e07df1541a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// TTSDKConfig.h
|
||||
// TapTapSDK
|
||||
//
|
||||
// Created by wzb on 2020/5/13.
|
||||
// Copyright © 2020 易玩. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
#define TapLoginSDKErrorDomain @"TapLoginSDKErrorDomain"
|
||||
|
||||
typedef NS_ENUM (NSInteger, RegionType) {
|
||||
RegionTypeCN,
|
||||
RegionTypeIO
|
||||
};
|
||||
|
||||
@interface TTSDKConfig : NSObject
|
||||
|
||||
/// 是否为圆角,默认为圆角
|
||||
@property (nonatomic, assign) BOOL roundCorner;
|
||||
/// 限定登录客户端
|
||||
@property (nonatomic, assign) RegionType regionType;
|
||||
/// Server URL
|
||||
@property (nonatomic, copy) NSString *serverURL;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a9bf7a68eb0064940bdafa002b57126e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// TTSDKLoginResult.h
|
||||
// TapTapSDK
|
||||
//
|
||||
// Created by TapTap on 2017/10/17.
|
||||
// Copyright © 2017年 易玩. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class TTSDKAccessToken;
|
||||
|
||||
/**
|
||||
* @brief 登入结果
|
||||
*
|
||||
* 该类封装了登入的响应结果(非NSError情况下)
|
||||
*/
|
||||
@interface TTSDKLoginResult : NSObject
|
||||
|
||||
/// 授权Token
|
||||
@property (nonatomic, copy) TTSDKAccessToken *token;
|
||||
|
||||
/// 用户是否选择取消授权(非拒绝授权,拒绝授权将在NSError中进行返回)
|
||||
@property (nonatomic, readonly) BOOL isCancelled;
|
||||
|
||||
- (instancetype)initWithToken:(TTSDKAccessToken *)token
|
||||
isCancelled:(BOOL)isCancelled;
|
||||
|
||||
@end
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bc7910d23d0b545c0bba3d9ea62e2b8a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// TTSDKProfile.h
|
||||
// TapTapSDK
|
||||
//
|
||||
// Created by TapTap on 2017/10/27.
|
||||
// Copyright © 2017年 易玩. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* @brief TapTap用户信息封装类
|
||||
*
|
||||
* 该类封装了所有用户信息提供的返回数据
|
||||
*/
|
||||
@interface TTSDKProfile : NSObject
|
||||
|
||||
/// 用户名
|
||||
@property (nonatomic, readonly, strong) NSString *name;
|
||||
|
||||
/// 用户头像
|
||||
@property (nonatomic, readonly, strong) NSString *avatar;
|
||||
|
||||
/// open id
|
||||
@property (nonatomic, readonly, strong) NSString *openid;
|
||||
|
||||
/// union id
|
||||
@property (nonatomic, readonly, strong) NSString *unionid;
|
||||
|
||||
@property (nonatomic, readonly, strong) NSString *email;
|
||||
|
||||
@property (nonatomic, readonly, assign, getter = isEmailVerified) BOOL emailVerified;
|
||||
|
||||
- (instancetype)initWithJSON:(NSDictionary *)json;
|
||||
|
||||
/**
|
||||
* @brief 获取当前用户信息
|
||||
*
|
||||
* 该用户信息会优先读取本地缓存,不存在时将会返回nil
|
||||
*/
|
||||
+ (TTSDKProfile *)currentProfile;
|
||||
|
||||
+ (void)fetchProfileForCurrentAccessToken:(void (^)(TTSDKProfile *profile, NSError *error))handler;
|
||||
|
||||
- (NSString *)toJsonString;
|
||||
|
||||
- (NSDictionary *)toDictionary;
|
||||
@end
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4378d9768be484d1c9c64590759c38a9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// TapAuth.h
|
||||
// TapLoginSDK
|
||||
//
|
||||
// Created by 黄驿峰 on 2023/9/14.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <TapLoginSDK/TapAuthResult.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void (^TapAuthManagerRequestHandler)(TapAuthResult *result);
|
||||
|
||||
@interface TapAuth : NSObject
|
||||
|
||||
+ (BOOL)isPreApproved;
|
||||
|
||||
+ (void)setPreApproved:(BOOL)preApproved;
|
||||
|
||||
/// 开始登录流程
|
||||
/// @param permissions 权限列表
|
||||
/// @param targetViewController 需要展现的页面
|
||||
+ (void)requestPermissions:(NSArray *)permissions fromController:(UIViewController *_Nullable)targetViewController handler:(TapAuthManagerRequestHandler)handler;
|
||||
|
||||
+ (void)requestPermissions:(NSArray *)permissions handler:(TapAuthManagerRequestHandler)handler;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 137873271f65a456190d6f01e4ab6277
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// TapAuthResult.h
|
||||
// TapCommonSDK
|
||||
//
|
||||
// Created by 黄驿峰 on 2022/1/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <TapLoginSDK/TTSDKAccessToken.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, TapAuthResultType) {
|
||||
TapAuthResultTypeSuccess,
|
||||
TapAuthResultTypeCancel,
|
||||
TapAuthResultTypeError,
|
||||
};
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TapAuthResult : NSObject
|
||||
|
||||
@property (nonatomic, assign, readonly) TapAuthResultType type;
|
||||
|
||||
@property (nonatomic, strong, nullable, readonly) TTSDKAccessToken *token;
|
||||
|
||||
@property (nonatomic, strong, nullable, readonly) NSError *error;
|
||||
|
||||
+ (instancetype)successWithToken:(TTSDKAccessToken *)token;
|
||||
+ (instancetype)failWithError:(NSError *)error;
|
||||
+ (instancetype)cancel;
|
||||
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c084a98346de54b6490c31c1e2eb4314
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,59 @@
|
|||
//
|
||||
// TapFriends.h
|
||||
// TapLoginSDK
|
||||
//
|
||||
// Created by pzheng on 2022/02/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// Tap Friend Info
|
||||
@interface TapFriendInfo : NSObject
|
||||
|
||||
/// Nickname.
|
||||
@property (nonatomic, readonly) NSString *name;
|
||||
|
||||
/// Avatar.
|
||||
@property (nonatomic, readonly) NSString *avatar;
|
||||
|
||||
/// Open ID.
|
||||
@property (nonatomic, readonly) NSString *openid;
|
||||
|
||||
@end
|
||||
|
||||
/// Query Result
|
||||
@interface TapFriendResult : NSObject
|
||||
|
||||
/// List of `TapFriendInfo`.
|
||||
@property (nonatomic, nullable, readonly) NSArray<TapFriendInfo *> *data;
|
||||
|
||||
/// The start index of the next query.
|
||||
@property (nonatomic, nullable, readonly) NSString *cursor;
|
||||
|
||||
@end
|
||||
|
||||
/// Query Option
|
||||
@interface TapFriendQueryOption : NSObject
|
||||
|
||||
/// The limit of the result.
|
||||
@property (nonatomic) NSUInteger size;
|
||||
|
||||
/// The start index of this query.
|
||||
@property (nonatomic, nullable) NSString *cursor;
|
||||
|
||||
@end
|
||||
|
||||
/// Tap Friends
|
||||
@interface TapFriends : NSObject
|
||||
|
||||
/// Query mutual list.
|
||||
/// @param option See `TapFriendQueryOption`.
|
||||
/// @param callback Result callback.
|
||||
+ (void)queryMutualListWithOption:(TapFriendQueryOption * _Nullable)option
|
||||
callback:(void (^)(TapFriendResult * _Nullable result, NSError * _Nullable error))callback;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b6f33f68099984998abe53d03bb2c2c6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,88 @@
|
|||
//
|
||||
// TapLoginHelper.h
|
||||
// TapTapLoginSource
|
||||
//
|
||||
// Created by Bottle K on 2020/12/2.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <TapLoginSDK/TTSDKConfig.h>
|
||||
#import <TapLoginSDK/TTSDKAccessToken.h>
|
||||
#import <TapLoginSDK/TTSDKProfile.h>
|
||||
#import <TapLoginSDK/TTSDKLoginResult.h>
|
||||
#import <TapLoginSDK/AccountGlobalError.h>
|
||||
#import <TapLoginSDK/TapTapLoginResultDelegate.h>
|
||||
|
||||
#define TapLoginSDK @"TapLogin"
|
||||
#define TapLoginSDK_VERSION_NUMBER @"32200001"
|
||||
#define TapLoginSDK_VERSION @"3.22.0"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TapLoginHelper : NSObject
|
||||
|
||||
/// 初始化
|
||||
/// @param clientID clientID
|
||||
+ (void)initWithClientID:(NSString *)clientID;
|
||||
|
||||
/// 初始化
|
||||
/// @param clientID clientID
|
||||
/// @param config 配置项
|
||||
+ (void)initWithClientID:(NSString *)clientID config:(TTSDKConfig *_Nullable)config;
|
||||
|
||||
/// 修改登录配置
|
||||
/// @param config 配置项
|
||||
+ (void)changeTapLoginConfig:(TTSDKConfig *_Nullable)config;
|
||||
|
||||
/// 设置登录回调
|
||||
/// @param delegate 回调
|
||||
+ (void)registerLoginResultDelegate:(id <TapTapLoginResultDelegate>)delegate;
|
||||
|
||||
/// 移除登录回调
|
||||
+ (void)unregisterLoginResultDelegate;
|
||||
|
||||
/// 获取当前设置的登录回调
|
||||
+ (id <TapTapLoginResultDelegate> _Nullable)getLoginResultDelegate;
|
||||
|
||||
/// 开始登录流程
|
||||
/// @param permissions 权限列表
|
||||
+ (void)startTapLogin:(NSArray *)permissions;
|
||||
|
||||
/// 开始登录流程
|
||||
/// @param targetViewController 需要展现的页面
|
||||
/// @param permissions 权限列表
|
||||
+ (void)startTapLogin:(UIViewController *_Nullable)targetViewController permissions:(NSArray *)permissions;
|
||||
|
||||
/// 获取当前 Token
|
||||
+ ( TTSDKAccessToken * _Nullable )currentAccessToken;
|
||||
|
||||
/// 获取当前 Profile
|
||||
+ ( TTSDKProfile * _Nullable )currentProfile;
|
||||
|
||||
/// 获取当前服务器上最新的 Profile
|
||||
/// @param callback 回调
|
||||
+ (void)fetchProfileForCurrentAccessToken:(void (^)(TTSDKProfile *profile, NSError *error))callback;
|
||||
|
||||
/// 登出
|
||||
+ (void)logout;
|
||||
|
||||
/// 获取当前用户是否有测试资格
|
||||
/// @param callback 回调
|
||||
+ (void)getTestQualification:(void (^)(BOOL isQualified, NSError *_Nullable error))callback;
|
||||
|
||||
/// 当前是否有国内客户端支持
|
||||
+ (BOOL)isTapTapClientSupport;
|
||||
|
||||
/// 当前是否有国外客户端支持
|
||||
+ (BOOL)isTapTapGlobalClientSupport;
|
||||
|
||||
/// 监听 url 回调
|
||||
/// @param url url
|
||||
+ (BOOL)handleTapTapOpenURL:(NSURL *)url __attribute__((deprecated("Please use [TDSHandleUrl handleOpenURL:]")));
|
||||
|
||||
/// 添加预设的登录请求权限
|
||||
+ (void)appendPermission:(NSString *)permission;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue