feat(*): update namespace to TapTap.ModuleName

xiaoyi 2021-04-07 16:20:41 +08:00
commit 68c3547036
47 changed files with 625 additions and 0 deletions

0
CHANGELOG.md Normal file
View File

7
CHANGELOG.md.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: eeb07bf1995f44e02bf1e2f6c996794c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Documentations.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fbdcfe20063da447f8f40a469752cb35
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
Documentations/README.md Normal file
View File

@ -0,0 +1 @@
# TapTap.Login

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bba3a05fa298643d1a20c3cab5614c17
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
Editor.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 66c985194a5444c2a336b60bdb132f74
timeCreated: 1617120951

View File

@ -0,0 +1,24 @@
using TapTap.Common.Editor;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
namespace TapTap.Login.Editor
{
public static class TapLoginIOSProcessor
{
[PostProcessBuild(102)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
if (buildTarget != BuildTarget.iOS) return;
var unityAppControllerPath = path + "/Classes/UnityAppController.mm";
var unityAppController = new TapFileHelper(unityAppControllerPath);
unityAppController.WriteBelow(@"#import <OpenGLES/ES2/glext.h>", @"#import <TapLoginSDK/TapLoginHelper.h>");
unityAppController.WriteBelow(
@"id sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey], annotation = options[UIApplicationOpenURLOptionsAnnotationKey];",
@"if(url){[TapLoginHelper handleTapTapOpenURL:url];}");
Debug.Log("TapLogin Change AppControler File!");
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 50ded018333a4dc8ba19e7806c5bc693
timeCreated: 1617120951

View File

@ -0,0 +1,16 @@
{
"name": "TapTap.Login.Editor",
"references": [
"TapTap.Common.Editor"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a9157d20880b14db485aa407a4532958
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Plugins.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 389763214cb6d491d83a645bbf33a750
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Plugins/Android.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4b872f00946c04ccea41c19eb6ae406a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0ef9a962e4bd24262a889ea13fed9c07
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 6ec7a91883ced46e399a9c7f05e67793
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:

8
Plugins/iOS.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 667a75a1a23fe417c89c8e75fdba321b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
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: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9a19e2245a4744703bff86fb4853c66b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 97939fdd061ab4d90939d91b4198cb1d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
//
// 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 <TapLoginResultDelegate>)delegate;
+ (void)removeSDKLoginResultDelegate:(NSString *)sdkName;
+ (void)startSDKLogin:(NSString *)sdkName permission:(NSArray *)permissions;
+ (void)handleLoginError:(NSDictionary *)params;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 148536e3fde0a496b9417c45512a1c8b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,55 @@
//
// 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;
/// 根据JSON生成 TTSDKAccessToken
/// @param accessTokenString json字符串类型的AccessToken
+ (TTSDKAccessToken *)build:(NSString *)accessTokenString;
/// 通过参数生成实例
+ (TTSDKAccessToken *)build:(NSString *)kid accessToken:(NSString *)accessToken tokenType:(NSString *)tokenType macKey:(NSString *)macKey macAlgorithm:(NSString *)macAlgorithm;
/// 转换成json字符串
- (NSString *)toJsonString;
/**
* @brief
*
* nil
*/
+ (TTSDKAccessToken *)currentAccessToken;
+ (void)setCurrentToken:(TTSDKAccessToken *)token;
@end

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 68a2ff8f0fec64b8cb7d86f72ae728e5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
//
// TTSDKConfig.h
// TapTapSDK
//
// Created by wzb on 2020/5/13.
// Copyright © 2020 易玩. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM (NSInteger, RegionType) {
RegionTypeCN,
RegionTypeIO
};
@interface TTSDKConfig : NSObject
/// 是否为圆角,默认为圆角
@property (nonatomic, assign) BOOL roundCorner;
/// 限定登录客户端
@property (nonatomic, assign) RegionType regionType;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 265ee932c73b84af79a570fcc7283e6d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 54e0d5b3ce4304a53bb525f35fcf9668
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,42 @@
//
// 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) NSString *name;
/// 用户头像
@property (nonatomic, readonly) NSString *avatar;
/// open id
@property (nonatomic, readonly) NSString *openid;
/// union id
@property (nonatomic, readonly) NSString *unionid;
- (instancetype)initWithJSON:(NSDictionary *)json;
/**
* @brief
*
* nil
*/
+ (TTSDKProfile *)currentProfile;
+ (void)fetchProfileForCurrentAccessToken:(void (^)(TTSDKProfile *profile, NSError *error))handler;
- (NSString *)toJsonString;
@end

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a4401666e68d742f59f6f633c267a11d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,71 @@
//
// TapLoginHelper.h
// TapTapLoginSource
//
// Created by Bottle K on 2020/12/2.
//
#import <Foundation/Foundation.h>
#import "TTSDKConfig.h"
#import "TTSDKAccessToken.h"
#import "TTSDKProfile.h"
#import "TTSDKLoginResult.h"
#import "AccountGlobalError.h"
#import "TapLoginResultDelegate.h"
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 <TapLoginResultDelegate>)delegate;
/// 移除登录回调
+ (void)unregisterLoginResultDelegate;
/// 获取当前设置的登录回调
+ (id <TapLoginResultDelegate>)getLoginResultDelegate;
/// 开始登录流程
/// @param permissions 权限列表
+ (void)startTapLogin:(NSArray *)permissions;
/// 获取当前 Token
+ (TTSDKAccessToken *)currentAccessToken;
/// 获取当前 Profile
+ (TTSDKProfile *)currentProfile;
/// 获取当前服务器上最新的 Profile
/// @param callback 回调
+ (void)fetchProfileForCurrentAccessToken:(void (^)(TTSDKProfile *profile, NSError *error))callback;
/// 登出
+ (void)logout;
/// 当前是否有国内客户端支持
+ (BOOL)isTapTapClientSupport;
/// 当前是否有国外客户端支持
+ (BOOL)isTapTapGlobalClientSupport;
/// 监听 url 回调
/// @param url url
+ (BOOL)handleTapTapOpenURL:(NSURL *)url;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9d7d98fbfde5d4f4eb797ee5ccc6335e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
//
// TapLoginResultDelegate.h
// Pods-TDSLoginSource_Example
//
// Created by Bottle K on 2020/12/15.
//
#import <Foundation/Foundation.h>
#import <TapLoginSDK/AccountGlobalError.h>
#import <TapLoginSDK/TTSDKAccessToken.h>
NS_ASSUME_NONNULL_BEGIN
@protocol TapLoginResultDelegate <NSObject>
/// 登录成功回调
/// @param token token对象
- (void)onLoginSuccess:(TTSDKAccessToken *)token;
/// 登录取消
- (void)onLoginCancel;
/// 登录失败
/// @param error 失败原因
- (void)onLoginError:(AccountGlobalError *)error;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9aef9c401c2bc4e40ac296c65df13a85
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
//
// TapLoginSDK.h
// TapLoginSDK
//
// Created by Bottle K on 2021/3/25.
//
#import <Foundation/Foundation.h>
//! Project version number for TapLoginSDK.
FOUNDATION_EXPORT double TapLoginSDKVersionNumber;
//! Project version string for TapLoginSDK.
FOUNDATION_EXPORT const unsigned char TapLoginSDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <TapLoginSDK/PublicHeader.h>
#import <TapLoginSDK/TTSDKConfig.h>
#import <TapLoginSDK/TapLoginHelper.h>
#import <TapLoginSDK/TTSDKProfile.h>
#import <TapLoginSDK/TTSDKAccessToken.h>
#import <TapLoginSDK/AccountGlobalError.h>
#import <TapLoginSDK/TTSDKLoginResult.h>
#import <TapLoginSDK/IscTaploginService.h>
#import <TapLoginSDK/TapLoginResultDelegate.h>

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2ed20b518f02644adb480a8881a7281c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d9ebb553f15d34b9794b4a512d80bee3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5cb748e3e01304072a70ba47a5f885ad
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,6 @@
framework module TapLoginSDK {
umbrella header "TapLoginSDK.h"
export *
module * { export * }
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a3b916fd9084a467e93d19e152f25171
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 767ff41c13d7d4a1c8a8fbd3d89b26c7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
README.md Normal file
View File

@ -0,0 +1 @@
## [TapTap.Login](./Documentations/README.md)

7
README.md.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c720d298abf1847cca49e4f58f9972e8
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

11
package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "com.tapsdk.login",
"displayName": "Tap Login",
"description": "TapTap Develop Service",
"version": "2.0.0",
"unity": "2018.3",
"license": "MIT",
"dependencies": {
"com.tapsdk.common": "https://github.com/TapTap/TapCommon-Unity.git#0.0.1"
}
}

7
package.json.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d54fc765f2f474819a39d6afc88f26d5
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: