开发版本-developer——01 first commit

This commit is contained in:
wbzhan
2019-07-08 18:24:03 +08:00
parent 5a10dfa182
commit 8693efe121
386 changed files with 7069 additions and 1951 deletions
@@ -0,0 +1,34 @@
//
// aluEnvConfig.h
// AliUniversalAccount
//
// Created by ethan on 12/14/15.
// Copyright © 2015 Alipay. All rights reserved.
//
#import <Foundation/Foundation.h>
/** 环境 */
typedef NS_ENUM (NSUInteger, ALBBEnvironment) {
/** 测试环境 */
ALBBEnvironmentDaily,
/** 预发环境 */
ALBBEnvironmentPreRelease,
/** 线上环境 */
ALBBEnvironmentRelease,
};
@interface ALBBEnvConfig : NSObject
@property (nonatomic, strong)NSString *additional;
+ (instancetype)shareInstance;
- (void) setGWServerSettings:(ALBBEnvironment) env;
- (BOOL) isDaily;
- (BOOL) isPre;
- (BOOL) isOnline;
- (void)setSecAdditional:(NSString *)additional;
@end
@@ -0,0 +1,99 @@
//
// AlibabaAuthSDK.h
// AlibabaAuthSDK
//
// Created by Bangzhe Liu on 6/15/16.
// Copyright © 2016 taobao. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "ALBBSession.h"
#ifndef ALBBNotificationUserLoggedIn
#define ALBBNotificationUserLoggedIn @"ALBB_NOTIFICATION_USER_LOGGED_IN"
#endif
#ifndef ALBBNotificationUserLoggedOut
#define ALBBNotificationUserLoggedOut @"ALBB_NOTIFICATION_USER_LOGGED_OUT"
#endif
#ifndef ALBBNotificationUserGiveUpLogin
#define ALBBNotificationUserGiveUpLogin @"ALBB_NOTIFICATION_USER_GIVE_UP_LOGIN"
#endif
#ifndef ALBBNotificationH5LoginDismiss
#define ALBBNotificationH5LoginDismiss @"ALBB_NOTIFICATION_H5_LOGIN_DISMISS"
#endif
#define ALBB_SDK_VERSION @"1.1.0.25"
/** 回调定义 */
typedef void (^loginSuccessCallback)(ALBBSession *session);
typedef void (^loginFailureCallback)(ALBBSession *session,NSError *error);
typedef void (^loginResultHandler)(ALBBSession *session);
/*
* 授权标记
*/
typedef enum {
H5Only = 1 ,//只拉起h5授权
NormalAuth ,//正常授权(淘宝+h5
} AuthOption;
@interface ALBBSDK : NSObject
+ (ALBBSDK *)sharedInstance;
//必须在主线程调用
- (void)ALBBSDKInit;
- (void)auth:(UIViewController *)parentController
successCallback:(loginSuccessCallback) onSuccess
failureCallback:(loginFailureCallback) onFailure;
/**
设置总的登录成功失败回调
@param handler 登录结果的处理handler,可以通过TaeSession isLogin判断当前登录态
*/
- (void)setLoginResultHandler:(void (^)(ALBBSession *session))loginResultHandler;
/**
退出登录
*/
- (void)logout;
/**
是否是登录URL
*/
- (BOOL)isLoginURL:(NSString *)url;
/**
是否是登出URL
*/
- (BOOL)isLogoutUrl:(NSString *)url;
/**
是否是手淘跳回url
*/
- (BOOL)isTBBackUrl:(NSString *)url;
/**
手淘跳转回来,拿到url调用
@return (BOOL) 调用是否成功
*/
- (void)loginByURL:(NSURL *)url;
//如果是接入的极简版本需要手动设置appkey
- (void)setAppkey : (NSString *)appKey;
- (void)openDebugLog;
- (void)setUUID:(NSString *)uuid;
//种本地cookie,初始化已经自动种过,目前供微博使用,微博有清除cookie逻辑,之后需要把登录cookie种回来
- (void)loadCookies;
- (void)setAuthOption:(AuthOption)authOption;
@end
@@ -0,0 +1,32 @@
//
// ALBBSession.h
// AlibabaAuthSDK
//
// Created by Bangzhe Liu on 6/17/16.
// Copyright © 2016 taobao. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ALBBUser.h"
@interface ALBBSession : NSObject
@property(nonatomic, assign)BOOL isCanceledByUser;
@property(nonatomic, copy)NSString* bindCode;
/**
@return 返回单例
*/
+ (ALBBSession *)sharedInstance;
/**
如果未登录或者登录态已经过期,返回NO
@return 当前会话是否登录有效
*/
- (BOOL)isLogin;
/**
@return 返回User对象
*/
- (ALBBUser *)getUser;
@end
@@ -0,0 +1,27 @@
//
// ALBBUser.h
// AlibabaAuthSDK
//
// Created by Bangzhe Liu on 6/17/16.
// Copyright © 2016 taobao. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ALBBUser : NSObject
/** 昵称 */
@property (nonatomic, copy, readonly) NSString *nick;
/** 头像地址 */
@property (nonatomic, copy, readonly) NSString *avatarUrl;
@property (nonatomic, copy, readonly) NSString *openId;
@property (nonatomic, copy, readonly) NSString *openSid;
@property (nonatomic, copy, readonly) NSString *topAccessToken;
@property (nonatomic, copy, readonly) NSString *topAuthCode;
- (instancetype)initWithNick:(NSString *)nick avatarUrl:(NSString *)avatarUrl openId:(NSString *)openId openSid:(NSString *)openSid topAccessToken:(NSString *)topAccessToken topAuthCode:(NSString*)authCode;
- (NSString *)ALBBUserDescription;
@end
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15G31</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>AlibabaAuthSDK</string>
<key>CFBundleIdentifier</key>
<string>com.taobao.AlibabaAuthSDK</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AlibabaAuthSDK</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0.24-SNAPSHOT</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string></string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>14B72</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>DTPlatformVersion</key>
<string>10.1</string>
<key>DTSDKBuild</key>
<string>14B72</string>
<key>DTSDKName</key>
<string>iphoneos10.1</string>
<key>DTXcode</key>
<string>0810</string>
<key>DTXcodeBuild</key>
<string>8B62</string>
<key>MinimumOSVersion</key>
<string>7.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
</dict>
</plist>