com.taptap.sdk.login 4.3.0-aplha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Mobile/Editor/NativeDependencies.xml +20 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapLoginIOSProcessor.cs +91 -0
- package/Mobile/Editor/TapLoginIOSProcessor.cs.meta +11 -0
- package/Mobile/Editor/TapLoginMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapLoginMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapSDK.Login.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapSDK.Login.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +8 -0
- package/Mobile/Runtime/AccountWrapper.cs +32 -0
- package/Mobile/Runtime/AccountWrapper.cs.meta +3 -0
- package/Mobile/Runtime/TapSDK.Login.Mobile.Runtime.asmdef +20 -0
- package/Mobile/Runtime/TapSDK.Login.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapTapLoginImpl.cs +81 -0
- package/Mobile/Runtime/TapTapLoginImpl.cs.meta +3 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Plugins/iOS/TapTapSDKLoginAppDelegate.mm +40 -0
- package/Plugins/iOS/TapTapSDKLoginAppDelegate.mm.meta +37 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins/zxing.unity.dll +0 -0
- package/Plugins/zxing.unity.dll.meta +33 -0
- package/Plugins.meta +8 -0
- package/Runtime/Internal/ITapTapLoginPlatform.cs +15 -0
- package/Runtime/Internal/ITapTapLoginPlatform.cs.meta +3 -0
- package/Runtime/Internal/Init/LoginInitTask.cs +20 -0
- package/Runtime/Internal/Init/LoginInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/Region.cs +98 -0
- package/Runtime/Internal/Region.cs.meta +11 -0
- package/Runtime/Internal/TapTapLoginManager.cs +38 -0
- package/Runtime/Internal/TapTapLoginManager.cs.meta +3 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/Public/AccessToken.cs +83 -0
- package/Runtime/Public/AccessToken.cs.meta +11 -0
- package/Runtime/Public/Profile.cs +51 -0
- package/Runtime/Public/Profile.cs.meta +11 -0
- package/Runtime/Public/TapTapAccount.cs +70 -0
- package/Runtime/Public/TapTapAccount.cs.meta +3 -0
- package/Runtime/Public/TapTapLogin.cs +39 -0
- package/Runtime/Public/TapTapLogin.cs.meta +3 -0
- package/Runtime/Public/TapTapSdk.cs +26 -0
- package/Runtime/Public/TapTapSdk.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Login.Runtime.asmdef +15 -0
- package/Runtime/TapSDK.Login.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Standalone/Editor/TapLoginStandaloneProcessBuild.cs +22 -0
- package/Standalone/Editor/TapLoginStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.Login.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.Login.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Resources/Prefabs/TapLogin/LoginPanel.prefab +811 -0
- package/Standalone/Resources/Prefabs/TapLogin/LoginPanel.prefab.meta +8 -0
- package/Standalone/Resources/Prefabs/TapLogin/LoginWithPermissionPanel.prefab +820 -0
- package/Standalone/Resources/Prefabs/TapLogin/LoginWithPermissionPanel.prefab.meta +8 -0
- package/Standalone/Resources/Prefabs/TapLogin/PermissionItem.prefab +314 -0
- package/Standalone/Resources/Prefabs/TapLogin/PermissionItem.prefab.meta +7 -0
- package/Standalone/Resources/Prefabs/TapLogin/QRCodeContainer.prefab +1501 -0
- package/Standalone/Resources/Prefabs/TapLogin/QRCodeContainer.prefab.meta +7 -0
- package/Standalone/Resources/Prefabs/TapLogin/Tips.prefab +286 -0
- package/Standalone/Resources/Prefabs/TapLogin/Tips.prefab.meta +7 -0
- package/Standalone/Resources/Prefabs/TapLogin/TopBar.prefab +485 -0
- package/Standalone/Resources/Prefabs/TapLogin/TopBar.prefab.meta +7 -0
- package/Standalone/Resources/Prefabs/TapLogin/WebContainer.prefab +514 -0
- package/Standalone/Resources/Prefabs/TapLogin/WebContainer.prefab.meta +7 -0
- package/Standalone/Resources/Prefabs/TapLogin/WebWithPermissionContainer.prefab +988 -0
- package/Standalone/Resources/Prefabs/TapLogin/WebWithPermissionContainer.prefab.meta +7 -0
- package/Standalone/Resources/Prefabs/TapLogin.meta +8 -0
- package/Standalone/Resources/Prefabs/TapTapSdkWindow.prefab +175 -0
- package/Standalone/Resources/Prefabs/TapTapSdkWindow.prefab.meta +8 -0
- package/Standalone/Resources/Prefabs.meta +8 -0
- package/Standalone/Resources/Sprites/taptap-client-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-client-bg.png.meta +92 -0
- package/Standalone/Resources/Sprites/taptap-divider.png +0 -0
- package/Standalone/Resources/Sprites/taptap-divider.png.meta +146 -0
- package/Standalone/Resources/Sprites/taptap-login-android-client.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-android-client.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-checked-v2.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-checked-v2.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-checked.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-checked.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-unchecked.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-auth-unchecked.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-button-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-button-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-confirm-triangle.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-confirm-triangle.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-ios-client.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-ios-client.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-login-tips-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-login-tips-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-logo.png +0 -0
- package/Standalone/Resources/Sprites/taptap-logo.png.meta +130 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-error.png +0 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-error.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-info.png +0 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-info.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-success.png +0 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-success.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-warning.png +0 -0
- package/Standalone/Resources/Sprites/taptap-scan-tips-warning.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-cancel.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-cancel.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-guide.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-guide.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-logo.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-logo.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-qrcode-bg-grey.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-qrcode-bg-grey.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-qrcode-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-qrcode-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-refresh-btn-bg.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-refresh-btn-bg.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-sdk-refresh.png +0 -0
- package/Standalone/Resources/Sprites/taptap-sdk-refresh.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-tap-log-v2.png +0 -0
- package/Standalone/Resources/Sprites/taptap-tap-log-v2.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-tap-logo.png +0 -0
- package/Standalone/Resources/Sprites/taptap-tap-logo.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-web-login-icon-v2.png +0 -0
- package/Standalone/Resources/Sprites/taptap-web-login-icon-v2.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-web-login-icon.png +0 -0
- package/Standalone/Resources/Sprites/taptap-web-login-icon.png.meta +128 -0
- package/Standalone/Resources/Sprites/taptap-web-login.png +0 -0
- package/Standalone/Resources/Sprites/taptap-web-login.png.meta +146 -0
- package/Standalone/Resources/Sprites.meta +8 -0
- package/Standalone/Resources.meta +8 -0
- package/Standalone/Runtime/Internal/ContainerWindow.cs +67 -0
- package/Standalone/Runtime/Internal/ContainerWindow.cs.meta +11 -0
- package/Standalone/Runtime/Internal/LoginLanguage.cs +1117 -0
- package/Standalone/Runtime/Internal/LoginLanguage.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Net.cs +291 -0
- package/Standalone/Runtime/Internal/Net.cs.meta +11 -0
- package/Standalone/Runtime/Internal/QRCodeWindow.cs +776 -0
- package/Standalone/Runtime/Internal/QRCodeWindow.cs.meta +11 -0
- package/Standalone/Runtime/Internal/UI.cs +22 -0
- package/Standalone/Runtime/Internal/UI.cs.meta +11 -0
- package/Standalone/Runtime/Internal/UIAnimator.cs +77 -0
- package/Standalone/Runtime/Internal/UIAnimator.cs.meta +11 -0
- package/Standalone/Runtime/Internal/UIBase.cs +27 -0
- package/Standalone/Runtime/Internal/UIBase.cs.meta +11 -0
- package/Standalone/Runtime/Internal/UIElement.cs +185 -0
- package/Standalone/Runtime/Internal/UIElement.cs.meta +11 -0
- package/Standalone/Runtime/Internal/UIManager.cs +100 -0
- package/Standalone/Runtime/Internal/UIManager.cs.meta +11 -0
- package/Standalone/Runtime/Internal/WebLoginRequestManager.cs +185 -0
- package/Standalone/Runtime/Internal/WebLoginRequestManager.cs.meta +11 -0
- package/Standalone/Runtime/Internal.meta +8 -0
- package/Standalone/Runtime/Internal2/AccountManager.cs +87 -0
- package/Standalone/Runtime/Internal2/AccountManager.cs.meta +3 -0
- package/Standalone/Runtime/Internal2/AuthorizationProviderImpl.cs +13 -0
- package/Standalone/Runtime/Internal2/AuthorizationProviderImpl.cs.meta +3 -0
- package/Standalone/Runtime/Internal2/Http/LoginHttpClient.cs +139 -0
- package/Standalone/Runtime/Internal2/Http/LoginHttpClient.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/Http/Response/ErrorResponse.cs +16 -0
- package/Standalone/Runtime/Internal2/Http/Response/ErrorResponse.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/Http/Response/ProfileResponse.cs +28 -0
- package/Standalone/Runtime/Internal2/Http/Response/ProfileResponse.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/Http/Response/QRCodeResponse.cs +22 -0
- package/Standalone/Runtime/Internal2/Http/Response/QRCodeResponse.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/Http/Response/TokenResponse.cs +33 -0
- package/Standalone/Runtime/Internal2/Http/Response/TokenResponse.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/Http/Response.meta +8 -0
- package/Standalone/Runtime/Internal2/Http.meta +8 -0
- package/Standalone/Runtime/Internal2/LoginService.cs +127 -0
- package/Standalone/Runtime/Internal2/LoginService.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/QRCodeUtils.cs +50 -0
- package/Standalone/Runtime/Internal2/QRCodeUtils.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/TapLoginStandaloneImpl.cs +181 -0
- package/Standalone/Runtime/Internal2/TapLoginStandaloneImpl.cs.meta +3 -0
- package/Standalone/Runtime/Internal2/UI/ClientButtonListener.cs +20 -0
- package/Standalone/Runtime/Internal2/UI/ClientButtonListener.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/UI/LoginPanelController.cs +72 -0
- package/Standalone/Runtime/Internal2/UI/LoginPanelController.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/UI/QRCodeController.cs +180 -0
- package/Standalone/Runtime/Internal2/UI/QRCodeController.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/UI/TitleController.cs +20 -0
- package/Standalone/Runtime/Internal2/UI/TitleController.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/UI/WebController.cs +125 -0
- package/Standalone/Runtime/Internal2/UI/WebController.cs.meta +11 -0
- package/Standalone/Runtime/Internal2/UI.meta +8 -0
- package/Standalone/Runtime/Internal2.meta +8 -0
- package/Standalone/Runtime/Public/IAuthorizationProvider.cs +9 -0
- package/Standalone/Runtime/Public/IAuthorizationProvider.cs.meta +3 -0
- package/Standalone/Runtime/Public/IComplianceProvider.cs +7 -0
- package/Standalone/Runtime/Public/IComplianceProvider.cs.meta +3 -0
- package/Standalone/Runtime/Public/TapTapLoginStandalone.cs +38 -0
- package/Standalone/Runtime/Public/TapTapLoginStandalone.cs.meta +3 -0
- package/Standalone/Runtime/Public.meta +8 -0
- package/Standalone/Runtime/TapSDK.Login.Standalone.Runtime.asmdef +24 -0
- package/Standalone/Runtime/TapSDK.Login.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone.meta +8 -0
- package/package.json +11 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<dependencies>
|
|
2
|
+
|
|
3
|
+
<!-- Android maven dependencies -->
|
|
4
|
+
<androidPackages>
|
|
5
|
+
<repositories>
|
|
6
|
+
<repository>https://repo.maven.apache.org/maven2</repository>
|
|
7
|
+
</repositories>
|
|
8
|
+
<androidPackage spec="com.taptap.sdk:tap-login-unity:4.3.0"/>
|
|
9
|
+
</androidPackages>
|
|
10
|
+
|
|
11
|
+
<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
|
|
12
|
+
<iosPods>
|
|
13
|
+
<sources>
|
|
14
|
+
<source>https://github.com/CocoaPods/Specs.git</source>
|
|
15
|
+
</sources>
|
|
16
|
+
<iosPod name="Kingfisher" version="~> 6.0" bitcodeEnabled="false" addToAllTargets="false"/>
|
|
17
|
+
<iosPod name="TapTapLoginSDK" version="~> 4.3.0" bitcodeEnabled="false" addToAllTargets="false"/>
|
|
18
|
+
</iosPods>
|
|
19
|
+
</dependencies>
|
|
20
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.IO;
|
|
3
|
+
using TapSDK.Core.Editor;
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
using UnityEditor.Callbacks;
|
|
6
|
+
#if UNITY_IOS || UNITY_STANDALONE_OSX
|
|
7
|
+
using UnityEditor.iOS.Xcode;
|
|
8
|
+
#endif
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
|
|
11
|
+
namespace TapSDK.Login.Editor
|
|
12
|
+
{
|
|
13
|
+
#if UNITY_IOS || UNITY_STANDALONE_OSX
|
|
14
|
+
public static class TapLoginIOSProcessor
|
|
15
|
+
{
|
|
16
|
+
// 添加标签,unity导出工程后自动执行该函数
|
|
17
|
+
[PostProcessBuild(103)]
|
|
18
|
+
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
|
19
|
+
{
|
|
20
|
+
var parentFolder = Directory.GetParent(Application.dataPath)?.FullName;
|
|
21
|
+
|
|
22
|
+
var plistFile = TapFileHelper.RecursionFilterFile(parentFolder + "/Assets/Plugins/", "TDS-Info.plist");
|
|
23
|
+
|
|
24
|
+
if (plistFile == null || !plistFile.Exists)
|
|
25
|
+
{
|
|
26
|
+
Debug.LogError("TapSDK Can't find TDS-Info.plist in Project/Assets/Plugins/!");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if (buildTarget is BuildTarget.iOS)
|
|
31
|
+
{
|
|
32
|
+
#if UNITY_IOS
|
|
33
|
+
TapSDKCoreCompile.HandlerPlist(Path.GetFullPath(path), plistFile?.FullName ?? null);
|
|
34
|
+
#endif
|
|
35
|
+
}
|
|
36
|
+
else if (buildTarget is BuildTarget.StandaloneOSX)
|
|
37
|
+
{
|
|
38
|
+
Debug.Log($"path:{path}");
|
|
39
|
+
Debug.Log($"path:{Path.GetFullPath(path)}");
|
|
40
|
+
Debug.Log($"dir:{Path.GetDirectoryName(path)}");
|
|
41
|
+
Debug.Log($"dir:{Path.GetFileName(path)}");
|
|
42
|
+
// 获得工程路径
|
|
43
|
+
#if UNITY_2020_1_OR_NEWER
|
|
44
|
+
var directory = Path.GetDirectoryName(path);
|
|
45
|
+
if (string.IsNullOrEmpty(directory))
|
|
46
|
+
{
|
|
47
|
+
directory = "";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var fileName = Path.GetFileName(path);
|
|
51
|
+
if (!fileName.EndsWith(".xcodeproj"))
|
|
52
|
+
{
|
|
53
|
+
fileName += ".xcodeproj";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var projPath = Path.Combine(directory, $"{fileName}/project.pbxproj");
|
|
57
|
+
#elif UNITY_2019_1_OR_NEWER
|
|
58
|
+
var projPath = Path.Combine(path, "project.pbxproj");
|
|
59
|
+
#else
|
|
60
|
+
#endif
|
|
61
|
+
#if UNITY_IOS
|
|
62
|
+
TapSDKCoreCompile.HandlerPlist(Path.GetFullPath(path), plistFile.FullName, true);
|
|
63
|
+
#endif
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#if UNITY_IOS
|
|
67
|
+
var projPath1 = TapSDKCoreCompile.GetProjPath(path);
|
|
68
|
+
var proj = TapSDKCoreCompile.ParseProjPath(projPath1);
|
|
69
|
+
var target = TapSDKCoreCompile.GetUnityTarget(proj);
|
|
70
|
+
if (TapSDKCoreCompile.CheckTarget(target))
|
|
71
|
+
{
|
|
72
|
+
Debug.LogError("Unity-iPhone is NUll");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (TapSDKCoreCompile.HandlerIOSSetting(path,
|
|
76
|
+
Application.dataPath,
|
|
77
|
+
"TapTapLoginResource",
|
|
78
|
+
"com.taptap.sdk.login",
|
|
79
|
+
"Login",
|
|
80
|
+
new[] {"TapTapLoginResource.bundle"},
|
|
81
|
+
target, projPath1, proj, "TapTapLoginSDK"))
|
|
82
|
+
{
|
|
83
|
+
Debug.Log("TapLogin add Bundle Success!");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
Debug.LogWarning("TapLogin add Bundle Failed!");
|
|
87
|
+
#endif
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
#endif
|
|
91
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEditor.Build.Reporting;
|
|
3
|
+
using TapSDK.Core.Editor;
|
|
4
|
+
|
|
5
|
+
namespace TapSDK.Login.Mobile.Editor {
|
|
6
|
+
public class TapLoginMobileProcessBuild : SDKLinkProcessBuild {
|
|
7
|
+
public override int callbackOrder => 0;
|
|
8
|
+
|
|
9
|
+
public override string LinkPath => "TapTap/Login/link.xml";
|
|
10
|
+
|
|
11
|
+
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
12
|
+
new LinkedAssembly { Fullname = "TapSDK.Login.Runtime" },
|
|
13
|
+
new LinkedAssembly { Fullname = "TapSDK.Login.Mobile.Runtime" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
|
|
17
|
+
return BuildTargetUtils.IsSupportMobile(report.summary.platform);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Login.Mobile.Editor",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:56f3da7a178484843974054bafe77e73"
|
|
5
|
+
],
|
|
6
|
+
"includePlatforms": [
|
|
7
|
+
"Editor"
|
|
8
|
+
],
|
|
9
|
+
"excludePlatforms": [],
|
|
10
|
+
"allowUnsafeCode": false,
|
|
11
|
+
"overrideReferences": false,
|
|
12
|
+
"precompiledReferences": [],
|
|
13
|
+
"autoReferenced": true,
|
|
14
|
+
"defineConstraints": [],
|
|
15
|
+
"versionDefines": [],
|
|
16
|
+
"noEngineReferences": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using JetBrains.Annotations;
|
|
3
|
+
using TapSDK.Core;
|
|
4
|
+
using TapSDK.Login;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace TapSDK.Login.Mobile.Runtime
|
|
8
|
+
{
|
|
9
|
+
public class AccountWrapper
|
|
10
|
+
{
|
|
11
|
+
public int code { get; }
|
|
12
|
+
|
|
13
|
+
[CanBeNull] public string message { get; }
|
|
14
|
+
|
|
15
|
+
[CanBeNull] public TapTapAccount account { get; }
|
|
16
|
+
|
|
17
|
+
public AccountWrapper(string json)
|
|
18
|
+
{
|
|
19
|
+
if (string.IsNullOrEmpty(json))
|
|
20
|
+
{
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
var dict = Json.Deserialize(json) as Dictionary<string, object>;
|
|
24
|
+
code = SafeDictionary.GetValue<int>(dict, "code");
|
|
25
|
+
message = SafeDictionary.GetValue<string>(dict, "message");
|
|
26
|
+
if (dict.ContainsKey("content") && dict["content"] is Dictionary<string, object> accountDict)
|
|
27
|
+
{
|
|
28
|
+
account = new TapTapAccount(accountDict);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Login.Mobile.Runtime",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:e8754b6153389406c963cd52996cc80f",
|
|
5
|
+
"GUID:10560023d8780423cb943c7a324b69f2",
|
|
6
|
+
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7"
|
|
7
|
+
],
|
|
8
|
+
"includePlatforms": [
|
|
9
|
+
"Android",
|
|
10
|
+
"iOS"
|
|
11
|
+
],
|
|
12
|
+
"excludePlatforms": [],
|
|
13
|
+
"allowUnsafeCode": false,
|
|
14
|
+
"overrideReferences": false,
|
|
15
|
+
"precompiledReferences": [],
|
|
16
|
+
"autoReferenced": true,
|
|
17
|
+
"defineConstraints": [],
|
|
18
|
+
"versionDefines": [],
|
|
19
|
+
"noEngineReferences": false
|
|
20
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using TapSDK.Core;
|
|
4
|
+
using TapSDK.Login.Mobile.Runtime;
|
|
5
|
+
using TapSDK.Login.Internal;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using System.Runtime.InteropServices;
|
|
8
|
+
|
|
9
|
+
namespace TapSDK.Login.Mobile
|
|
10
|
+
{
|
|
11
|
+
public class TapTapLoginImpl: ITapTapLoginPlatform
|
|
12
|
+
{
|
|
13
|
+
#if UNITY_IOS
|
|
14
|
+
[DllImport("__Internal")]
|
|
15
|
+
private static extern void RegisterTapTapSDKLoginAppDelegateListener();
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
private const string SERVICE_NAME = "BridgeLoginService";
|
|
19
|
+
|
|
20
|
+
public void Init(string clientId, TapTapRegionType regionType)
|
|
21
|
+
{
|
|
22
|
+
|
|
23
|
+
#if UNITY_IOS
|
|
24
|
+
RegisterTapTapSDKLoginAppDelegateListener();
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
EngineBridge.GetInstance().Register(
|
|
28
|
+
"com.taptap.sdk.login.unity.BridgeLoginService",
|
|
29
|
+
"com.taptap.sdk.login.unity.BridgeLoginServiceImpl");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public Task<TapTapAccount> Login(string[] scopes)
|
|
33
|
+
{
|
|
34
|
+
var tsc = new TaskCompletionSource<TapTapAccount>();
|
|
35
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
36
|
+
.Service(SERVICE_NAME)
|
|
37
|
+
.Method("loginWithScope")
|
|
38
|
+
.Args("scopes", scopes)
|
|
39
|
+
.Callback(true)
|
|
40
|
+
.OnceTime(true)
|
|
41
|
+
.CommandBuilder(),
|
|
42
|
+
result =>
|
|
43
|
+
{
|
|
44
|
+
Debug.Log("Login result: " + result.content);
|
|
45
|
+
var wrapper = new AccountWrapper(result.content);
|
|
46
|
+
if (wrapper.code == 1)
|
|
47
|
+
{
|
|
48
|
+
tsc.TrySetCanceled();
|
|
49
|
+
} else if (wrapper.code == 0)
|
|
50
|
+
{
|
|
51
|
+
tsc.TrySetResult(wrapper.account);
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
{
|
|
55
|
+
tsc.TrySetException(new Exception(wrapper.message));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return tsc.Task;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public void Logout()
|
|
62
|
+
{
|
|
63
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
64
|
+
.Service(SERVICE_NAME)
|
|
65
|
+
.Method("logout")
|
|
66
|
+
.CommandBuilder());
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public async Task<TapTapAccount> GetCurrentAccount()
|
|
70
|
+
{
|
|
71
|
+
Result result = await EngineBridge.GetInstance().Emit(new Command.Builder()
|
|
72
|
+
.Service(SERVICE_NAME)
|
|
73
|
+
.Method("getCurrentTapAccount")
|
|
74
|
+
.Callback(true)
|
|
75
|
+
.OnceTime(true)
|
|
76
|
+
.CommandBuilder());
|
|
77
|
+
Debug.Log("Current account: " + result.content);
|
|
78
|
+
return new AccountWrapper(result.content).account;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
package/Mobile.meta
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
#import <UIKit/UIKit.h>
|
|
3
|
+
#import <TapTapLoginSDK/TapTapLoginSDK-Swift.h>
|
|
4
|
+
#import "UnityAppController.h"
|
|
5
|
+
#import <Foundation/Foundation.h>
|
|
6
|
+
#import <UIKit/UIKit.h>
|
|
7
|
+
#import "AppDelegateListener.h"
|
|
8
|
+
|
|
9
|
+
@interface TapTapSDKLoginAppDelegateListener : NSObject<AppDelegateListener>
|
|
10
|
+
|
|
11
|
+
+ (instancetype)sharedInstance;
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
@implementation TapTapSDKLoginAppDelegateListener
|
|
15
|
+
|
|
16
|
+
+ (instancetype)sharedInstance {
|
|
17
|
+
static TapTapSDKLoginAppDelegateListener *sharedInstance = nil;
|
|
18
|
+
static dispatch_once_t onceToken;
|
|
19
|
+
dispatch_once(&onceToken, ^{
|
|
20
|
+
sharedInstance = [[TapTapSDKLoginAppDelegateListener alloc] init];
|
|
21
|
+
});
|
|
22
|
+
return sharedInstance;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (void)onOpenURL:(NSNotification *)notification {
|
|
26
|
+
NSDictionary *userInfo = notification.userInfo;
|
|
27
|
+
NSURL *url = [userInfo valueForKey:@"url"];
|
|
28
|
+
if (url) {
|
|
29
|
+
[TapTapLogin openWithUrl:url];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@end
|
|
35
|
+
|
|
36
|
+
extern "C" void RegisterTapTapSDKLoginAppDelegateListener() {
|
|
37
|
+
TapTapSDKLoginAppDelegateListener *listener = TapTapSDKLoginAppDelegateListener.sharedInstance;
|
|
38
|
+
UnityRegisterAppDelegateListener(listener);
|
|
39
|
+
}
|
|
40
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 0e5df558f170c4e2fb2c95b8c7517383
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
iPhone: iOS
|
|
27
|
+
second:
|
|
28
|
+
enabled: 1
|
|
29
|
+
settings: {}
|
|
30
|
+
- first:
|
|
31
|
+
tvOS: tvOS
|
|
32
|
+
second:
|
|
33
|
+
enabled: 1
|
|
34
|
+
settings: {}
|
|
35
|
+
userData:
|
|
36
|
+
assetBundleName:
|
|
37
|
+
assetBundleVariant:
|
package/Plugins/iOS.meta
ADDED
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 44603b497110848c1bee102b300ad164
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 1
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
Windows Store Apps: WindowsStoreApps
|
|
27
|
+
second:
|
|
28
|
+
enabled: 0
|
|
29
|
+
settings:
|
|
30
|
+
CPU: AnyCPU
|
|
31
|
+
userData:
|
|
32
|
+
assetBundleName:
|
|
33
|
+
assetBundleVariant:
|
package/Plugins.meta
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
using System.Threading.Tasks;
|
|
2
|
+
using TapSDK.Core;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Login.Internal
|
|
5
|
+
{
|
|
6
|
+
public interface ITapTapLoginPlatform
|
|
7
|
+
{
|
|
8
|
+
void Init(string clientId, TapTapRegionType regionType);
|
|
9
|
+
Task<TapTapAccount> Login(string[] scopes);
|
|
10
|
+
|
|
11
|
+
void Logout();
|
|
12
|
+
|
|
13
|
+
Task<TapTapAccount> GetCurrentAccount();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Linq;
|
|
3
|
+
using TapSDK.Core;
|
|
4
|
+
using TapSDK.Core.Internal.Init;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.Login.Internal.Init {
|
|
7
|
+
public class LoginInitTask : IInitTask {
|
|
8
|
+
public int Order => 11;
|
|
9
|
+
|
|
10
|
+
public void Init(TapTapSDKCoreOptions coreOption, TapTapSDKBaseOption[] otherOptions)
|
|
11
|
+
{
|
|
12
|
+
TapTapLoginManager.Instance.Init(coreOption.clientId, coreOption.region);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public void Init(TapTapSDKCoreOptions coreOption)
|
|
16
|
+
{
|
|
17
|
+
TapTapLoginManager.Instance.Init(coreOption.clientId, coreOption.region);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
namespace TapSDK.Login.Internal
|
|
2
|
+
{
|
|
3
|
+
public abstract class Region
|
|
4
|
+
{
|
|
5
|
+
protected static bool isRND = false;
|
|
6
|
+
|
|
7
|
+
public abstract string WebHost();
|
|
8
|
+
|
|
9
|
+
public abstract string ApiHost();
|
|
10
|
+
|
|
11
|
+
public abstract string AccountHost();
|
|
12
|
+
|
|
13
|
+
public string CodeUrl()
|
|
14
|
+
{
|
|
15
|
+
return WebHost() + "/oauth2/v1/device/code";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public string TokenUrl()
|
|
19
|
+
{
|
|
20
|
+
return WebHost() + "/oauth2/v1/token";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public string ProfileUrl(bool havePublicProfile = true)
|
|
24
|
+
{
|
|
25
|
+
if (havePublicProfile)
|
|
26
|
+
{
|
|
27
|
+
return ApiHost() + "/account/profile/v1?client_id=";
|
|
28
|
+
}
|
|
29
|
+
else
|
|
30
|
+
{
|
|
31
|
+
return ApiHost() + "/account/basic-info/v1?client_id=";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public string AccountUrl()
|
|
36
|
+
{
|
|
37
|
+
return AccountHost() + "/authorize?";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public class RegionCN : Region {
|
|
42
|
+
|
|
43
|
+
private static string webHost = "https://accounts.tapapis.cn";
|
|
44
|
+
|
|
45
|
+
private static string apiHost = "https://open.tapapis.cn";
|
|
46
|
+
|
|
47
|
+
private static string accountHost = "https://accounts.taptap.cn";
|
|
48
|
+
|
|
49
|
+
private static string webHostRND = "https://oauth.api.xdrnd.cn";
|
|
50
|
+
|
|
51
|
+
private static string apiHostRND = "https://open.api.xdrnd.cn";
|
|
52
|
+
|
|
53
|
+
private static string accountHostRND = "https://accounts-beta.xdrnd.cn";
|
|
54
|
+
|
|
55
|
+
public override string WebHost()
|
|
56
|
+
{
|
|
57
|
+
return isRND ? webHostRND : webHost;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public override string ApiHost()
|
|
61
|
+
{
|
|
62
|
+
return isRND ? apiHostRND : apiHost;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public override string AccountHost()
|
|
66
|
+
{
|
|
67
|
+
return isRND ? accountHostRND : accountHost;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public class RegionIO : Region
|
|
73
|
+
{
|
|
74
|
+
private static string webHost = "https://accounts.tapapis.com";
|
|
75
|
+
private static string apiHost = "https://open.tapapis.com";
|
|
76
|
+
private static string accountHost = "https://accounts.taptap.io";
|
|
77
|
+
|
|
78
|
+
private static string webHostRND = "https://oauth.api.xdrnd.com";
|
|
79
|
+
private static string apiHostRND = "https://open.api.xdrnd.com";
|
|
80
|
+
private static string accountHostRND = "https://accounts-io-beta.xdrnd.com";
|
|
81
|
+
|
|
82
|
+
public override string WebHost()
|
|
83
|
+
{
|
|
84
|
+
return isRND ? webHostRND : webHost;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public override string ApiHost()
|
|
88
|
+
{
|
|
89
|
+
return isRND ? apiHostRND : apiHost;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public override string AccountHost()
|
|
93
|
+
{
|
|
94
|
+
return isRND ? accountHostRND : accountHost;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
}
|