123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- //
- // XenonSDK.h
- // XenonSDK
- //
- // Created by SAGESSE on 2019/1/20.
- // Copyright © 2019 SAGESSE. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #import "XSUtils.h"
- #import "XSTracker.h"
- #import "XSCollector.h"
- #import "XSNetwork.h"
- #import "XSUser.h"
- #import "XSConfiguration.h"
- #import "XSDataCenter.h"
- #import "FqGameAd.h"
- #import <AudioToolbox/AudioToolbox.h>
- ///
- /// Game SDK
- ///
- @interface XenonSDK : NSObject
- @property (nonatomic, strong) XSUser* user;
- @property (nonatomic, strong) XSConfiguration* configuration;
- @property (nonatomic, strong) void(^sdk_loginCallback)(id user);
- @property (nonatomic, strong) void(^sdk_logoutCallback)(id user);
- @property (nonatomic, strong) UIView* bubbleView;
- @property (nonatomic, strong) UIViewController* rootViewController;
- @property (nonatomic, strong) NSString* appId;
- @property (nonatomic, strong) NSString* channelId;
- @property (nonatomic, strong) NSString* adId;
- @property (nonatomic, strong) NSString* adFlag;
- @property (nonatomic, readonly) NSBundle* bundle;
- @property (nonatomic, readonly) NSString* version;
- @property (nonatomic, readonly) NSString* shortVersion;
- @property (nonatomic, readonly) NSString* model;
- @property (nonatomic, readonly) NSString* advertisingIdentifier;
- @property (nonatomic, readonly) NSString* advertisingVendor;
- @property (nonatomic, strong) NSString* token;
- /// A sington instance of SDK.
- + (instancetype)sharedSDK;
- /// Init the sdk with application code.
- - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
- /// Login the sdk.
- - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
- /// Logout the sdk.
- - (void)logoutWithComplete:(void (^)(void))complete;
- /// Logout the game and sdk.
- - (void)logoutWhenNotification:(void (^)(void))handler;
- /// Buy a product.
- - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
- /// User Center.
- - (void)center;
- /// Report role info.
- - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
- ///打开banner广告
- - (void)adBanner:(NSString*)adId;
- ///关闭banner广告
- - (void)closeBanner:(NSString*)adId;
- ///Inner广告
- - (void)adInner:(NSString*)adId complete:(void (^)(int))complete;
- ///视频激励广告
- - (void)adVideo:(NSString*)adId complete:(void (^)(int))complete;
- /// 打开一个原生广告
- /// @param adId 打开广告编号
- -(void)adNative:(NSString *)adId x:(int)x y:(int)y w:(int)width h:(int)hight;
- /// 获取某一个广告位广告是否可用
- /// @parm callback YES:可用, NO:不可用
- -(void)isAdReady:(NSString *)adName callback:(void(^)(BOOL))callback;
- /// 打开一个广告
- /// @param adName 广告位名称
- -(void)openAd:(NSString *)adName;
- /// 打开一个广告 带着播放结果回调
- -(void)openAd:(NSString *)adName callback:(void(^)(BOOL))callback;
- //关闭原生广告
- -(void)closeNative:(NSString *)adName;
- /// 生命周期启动入口
- /// @param application application对象
- -(void)applicationDidFinishLaunching:(UIApplication *)application;
- /// 游戏进入后台
- -(void)applicationDidEnterBackground;
- /// 游戏进入到前台
- -(void)applicationWillEnterForeground;
- /// 游戏开始活跃运行
- -(void)applicationDidBecomeActive;
- ///手机震动
- -(void)iphoneVibrate;
- ///跳转appstore评论
- -(void)skipToAppsotreWithID:(NSString *)appleId;
- ///自动登录
- -(void)autoLogin;
- ///手动登录
- -(void)manualLogin;
- /// 统计事件1
- /// @param eventName 事件名称
- -(void)tjEvent:(NSString *)eventName;
- /// 统计事件2
- /// @param eventName 事件名称
- /// @param value 事件对应值
- -(void)tjEvent:(NSString *)eventName value:(NSString *)value;
- @end
|