//
|
// 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;
|