123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- //
- // 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 "TalkingData.h"
- #import "MLAdManager.h"
- #import "YLHAdManager.h"
- #import "TOPONAdManager.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;
- ///自动登录
- - (void)hAutoWithComplete:(void (^)(id user, NSError* error))complete;
- ///check In-app Purchase lost list.
- - (void)checkOrderStatus;
- ///TalkingData 游戏运营统计
- /// 游戏运营init
- - (void)TDGameOperationsinitWithAppID:(NSString *)appid ChannelId:(NSString *)channelId;
- /// Register a user for data analyzer.
- - (void)TDregisterWithAccount:(NSString*)account name:(NSString*)name;
- /// Login a user for data analyzer.
- - (void)TDloginWithAccount:(NSString*)account name:(NSString*)name;
- /// report user's age and gender.
- -(void)TDreportWithAccount:(NSString*)account Name:(NSString *)name Age:(int)age Gender:(NSInteger)gender;
- /// report a user info
- -(void)TDreportWithAccount:(NSString*)account name:(NSString*)name level:(NSInteger)level server:(NSString*)server;
- //充值请求
- - (void)TDonChargeRequst:(NSString *)orderId
- iapId:(NSString *)iapId
- currencyAmount:(double)currencyAmount
- currencyType:(NSString *)currencyType
- virtualCurrencyAmount:(double)virtualCurrencyAmount
- paymentType:(NSString *)paymentType;
- //充值成功,确认玩家支付成功时调用.
- - (void)TDonChargeSuccess:(NSString *)orderId;
- //TD 自定义事件
- -(void)TDonEvent:(NSString *)eventId eventData:(id)parm;
- ///TalkingData 应用统计分析
- - (void)TDAnalyticsinitWithAppID:(NSString *)appid ChannelId:(NSString *)channelId backgroundSession:(BOOL)flag;
- ///进入页面统计(Begin和End同时调用)
- - (void)TDAnalyticsTrackPageBegin:(NSString *)pageName;
- ///离开页面统计
- - (void)TDAnalyticsTrackPageEnd:(NSString *)pageName;
- //自定义事件1,eventID:自定义事件名称
- - (void)TDAnalyticsTrackEvent:(NSString *)eventID;
- //自定义事件2,eventID:自定义事件名称, event_label:自定义事件Label,用来区分具体场景.
- - (void)TDAnalyticsTrackEvent:(NSString *)eventID label:(NSString *)event_label;
- //自定义事件3,eventID:自定义事件名称, event_label:自定义事件Label,用来区分具体场景. dict:自定义事件的参数及参数取值.
- - (void)TDAnalyticsTrackEvent:(NSString *)eventID label:(NSString *)event_label parameters:(NSDictionary *)dict;
- //应用内支付-创建订单
- -(TalkingDataOrder *)TDAnalyticsCreateOrder:(NSString *)orderId total:(int)total currencyType:(NSString *)currencyType;
- //应用内支付-添加订单详情
- - (TalkingDataOrder *)TDAnalyticsAddItem:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
- //应用内支付-成功支付订单
- - (void)TDAnalyticsOnPlaceOrder:(NSString *)profileID order:(TalkingDataOrder *)order;
- ///csj广告
- //1.初始化
- - (void)CSJAdSDKinit;
- //.打开全屏广告
- -(void)openBUDFullScreenVideoAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- //新插屏广告(新增)
- -(void)openBUDNewInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- //2.打开开屏广告
- -(void)openBUDSplashAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- //3. 打开插屏广告
- -(void)openBUDInterstitialAd:(NSString *)adName width:(CGFloat)w Height:(CGFloat)h callback:(void (^)(BOOL))callback;
- //4. 打开视频激励广告
- -(void)openBUDExpressRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
- //5.1 打开原生Banner广告
- -(void)openBUDNativeBannerAd:(NSString *)adName WithX:(CGFloat)x Y:(CGFloat)y Width:(CGFloat)w Height:(CGFloat)h callback:(void (^)(BOOL))callback;
- //5.2 关闭Banner广告
- -(void)closeBUDBannerAd:(NSString *)adName;
- //6. 打开原生广告
- -(void)openBUDNativeAd:(NSString *)adName WidthCGRect:(CGRect)rect BUSize:(NSInteger)size callback:(void (^)(BOOL))callback;
- ///优量汇广告
- //初始化
- -(void)YLHAdSDKinit;
- -(void)openYLHSplashAd:(NSString *)adName supportZoomoutView:(BOOL)flag callback:(void (^)(BOOL))callback;
- -(void)openYLHInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- -(void)openYLHFullScreenAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- -(void)openYLHExpressRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
- -(void)openYLHExpressBannerAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- -(void)openYLHExpressNativeAdWithPlacementId:(NSString *)placementId AdName:(NSString *)adName Frame:(CGRect)rect callback:(void (^)(BOOL))callback;
- //TopOn广告
- - (void)TopOnAdSDKinit;
- -(void)openTOPONSplashAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- -(void)openTOPONInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- -(void)openTOPONRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
- -(void)openTOPONExpressBannerAd:(NSString *)adName callback:(void (^)(BOOL))callback;
- -(void)openTOPONNativeAdWithX:(int)x Y:(int)y width:(int)w height:(int)h adId:(NSString *)adName callback:(void (^)(BOOL))callback;
- //extra
- -(void)showHudWith:(NSString *)name;
- @end
|