蔡瀚
2019-01-23 f2436e20adc90131dddfa5915915396020dd8976
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//
//  FreeSDK.h
//  FreeSDK
//
//  易乐SDK:v1.0.0
//  Created by 李英辉 on 1/11/17.
//
 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "YLAccount.h"
#import "YLOrder.h"
 
 
typedef enum{
    YLSDKTypeInitSuccess = 1,        //初始化成功
    YLSDKTypeInitFailure = 2,        //初始化失败
    YLSDKTypeSwitchAccount = 9,      //切换账号
    YLSDKTypePaySuccess=3,           //支付成功
    YLSDKTypePayFailed=4,
}YLSDKType;
 
// Release
#define YL_API_ENTRY    @"http://zysdk.zytxgame.com/api.php/Index/getUrl"
// Debug
//#define YL_API_ENTRY    @"http://111.230.244.198/api.php/Index/getUrl"
 
//是否在各个操作执行/完成时在屏幕上弹出提示文字,例如:账号已退出
#define YL_SHOW_ACTION_TIPS    YES
 
//API请求默认超时
#define YL_API_TIMEOUT  10
 
//sdk回调方法
extern void (^_blockSdk)(YLSDKType type ,NSString *msg);
 
/**
 *  SDK入口类,用于初始化SDK、包装调用细节等。
 */
@interface FreeSDK : NSObject
 
/**
*  初始化SDK
*
*  @param appId 授权接入的应用ID(由易乐分配给接入方)
*
*  @return 是否初始化成功
*/
+ (BOOL)initSDKWithAppId:(NSString *)appId withSDKBlock:(void (^)(YLSDKType type ,NSString *msg))sdkBlock;
 
/*
 * wx登录相关
 *  @param AppId     在微信开放平台获取
 *  @param AppSecret 在微信开放平台获取
 *  @return 是否初始化成功
 */
+ (BOOL)setupWeChatAppId:(NSString *)openId appSecret:(NSString *)appSecret;
 
/*
 * qq登录相关
 *  @param appId     在腾讯开放平台获取
 *  @return 是否初始化成功
 */
+ (void)setupQQAppId:(NSString *)appId;
//处理应用拉起协议
+ (BOOL)HandleOpenURL:(NSURL *)url;
 
/**
 *  弹出登录界面
 *
 *  @param parentController 容器页面(登录页面将通过该控制器弹出)
 *  @param rememberAccount 是否记住用户账号
 */
+ (void)presentLoginDialog:(UIViewController *)parentController;
 
/**
 *  退出当前登录的账号
 */
+ (void)logout;
 
 
+ (void)isCanPay:(void (^)(BOOL isCanPay, NSString * msg))result;
 
/**
 *  弹出实名认证界面
 *
 *  @param parentController 容器页面(实名认证页面将通过该控制器弹出)
 */
 
+ (void)showRealNameAuthentication:(UIViewController *)parentController;
 
/**
 *支付
 */
+(void)pay:(YLOrder *)order;
 
@end
 
 
/*
 * 全局通知。在接入SDK的客户端中订阅以下通知,以便在特定事件发生时触发某些逻辑。
 */
 
/**
 *  玩家取消登录
 */
extern NSString * const YLUserDidCancelLoginNotification;
 
/**
 *  玩家登录成功
 */
extern NSString * const YLUserDidLoginNotification;
 
/**
 *  玩家注册成功
 */
extern NSString * const YLUserDidSignUpNotification;