XenonSDK.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. //
  2. // XenonSDK.h
  3. // XenonSDK
  4. //
  5. // Created by SAGESSE on 2019/1/20.
  6. // Copyright © 2019 SAGESSE. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "XSUtils.h"
  10. #import "XSTracker.h"
  11. #import "XSCollector.h"
  12. #import "XSNetwork.h"
  13. #import "XSUser.h"
  14. #import "XSConfiguration.h"
  15. #import "XSDataCenter.h"
  16. #import "TalkingData.h"
  17. #import "MLAdManager.h"
  18. #import "YLHAdManager.h"
  19. #import "TOPONAdManager.h"
  20. ///
  21. /// Game SDK
  22. ///
  23. @interface XenonSDK : NSObject
  24. @property (nonatomic, strong) XSUser* user;
  25. @property (nonatomic, strong) XSConfiguration* configuration;
  26. @property (nonatomic, strong) void(^sdk_loginCallback)(id user);
  27. @property (nonatomic, strong) void(^sdk_logoutCallback)(id user);
  28. @property (nonatomic, strong) UIView* bubbleView;
  29. @property (nonatomic, strong) UIViewController* rootViewController;
  30. @property (nonatomic, strong) NSString* appId;
  31. @property (nonatomic, strong) NSString* channelId;
  32. @property (nonatomic, strong) NSString* adId;
  33. @property (nonatomic, strong) NSString* adFlag;
  34. @property (nonatomic, readonly) NSBundle* bundle;
  35. @property (nonatomic, readonly) NSString* version;
  36. @property (nonatomic, readonly) NSString* shortVersion;
  37. @property (nonatomic, readonly) NSString* model;
  38. @property (nonatomic, readonly) NSString* advertisingIdentifier;
  39. @property (nonatomic, readonly) NSString* advertisingVendor;
  40. @property (nonatomic, strong) NSString* token;
  41. /// A sington instance of SDK.
  42. + (instancetype)sharedSDK;
  43. /// Init the sdk with application code.
  44. - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
  45. /// Login the sdk.
  46. - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
  47. /// Logout the sdk.
  48. - (void)logoutWithComplete:(void (^)(void))complete;
  49. /// Logout the game and sdk.
  50. - (void)logoutWhenNotification:(void (^)(void))handler;
  51. /// Buy a product.
  52. - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
  53. /// User Center.
  54. - (void)center;
  55. /// Report role info.
  56. - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
  57. ///自动登录
  58. - (void)hAutoWithComplete:(void (^)(id user, NSError* error))complete;
  59. ///check In-app Purchase lost list.
  60. - (void)checkOrderStatus;
  61. ///TalkingData 游戏运营统计
  62. /// 游戏运营init
  63. - (void)TDGameOperationsinitWithAppID:(NSString *)appid ChannelId:(NSString *)channelId;
  64. /// Register a user for data analyzer.
  65. - (void)TDregisterWithAccount:(NSString*)account name:(NSString*)name;
  66. /// Login a user for data analyzer.
  67. - (void)TDloginWithAccount:(NSString*)account name:(NSString*)name;
  68. /// report user's age and gender.
  69. -(void)TDreportWithAccount:(NSString*)account Name:(NSString *)name Age:(int)age Gender:(NSInteger)gender;
  70. /// report a user info
  71. -(void)TDreportWithAccount:(NSString*)account name:(NSString*)name level:(NSInteger)level server:(NSString*)server;
  72. //充值请求
  73. - (void)TDonChargeRequst:(NSString *)orderId
  74. iapId:(NSString *)iapId
  75. currencyAmount:(double)currencyAmount
  76. currencyType:(NSString *)currencyType
  77. virtualCurrencyAmount:(double)virtualCurrencyAmount
  78. paymentType:(NSString *)paymentType;
  79. //充值成功,确认玩家支付成功时调用.
  80. - (void)TDonChargeSuccess:(NSString *)orderId;
  81. //TD 自定义事件
  82. -(void)TDonEvent:(NSString *)eventId eventData:(id)parm;
  83. ///TalkingData 应用统计分析
  84. - (void)TDAnalyticsinitWithAppID:(NSString *)appid ChannelId:(NSString *)channelId backgroundSession:(BOOL)flag;
  85. ///进入页面统计(Begin和End同时调用)
  86. - (void)TDAnalyticsTrackPageBegin:(NSString *)pageName;
  87. ///离开页面统计
  88. - (void)TDAnalyticsTrackPageEnd:(NSString *)pageName;
  89. //自定义事件1,eventID:自定义事件名称
  90. - (void)TDAnalyticsTrackEvent:(NSString *)eventID;
  91. //自定义事件2,eventID:自定义事件名称, event_label:自定义事件Label,用来区分具体场景.
  92. - (void)TDAnalyticsTrackEvent:(NSString *)eventID label:(NSString *)event_label;
  93. //自定义事件3,eventID:自定义事件名称, event_label:自定义事件Label,用来区分具体场景. dict:自定义事件的参数及参数取值.
  94. - (void)TDAnalyticsTrackEvent:(NSString *)eventID label:(NSString *)event_label parameters:(NSDictionary *)dict;
  95. //应用内支付-创建订单
  96. -(TalkingDataOrder *)TDAnalyticsCreateOrder:(NSString *)orderId total:(int)total currencyType:(NSString *)currencyType;
  97. //应用内支付-添加订单详情
  98. - (TalkingDataOrder *)TDAnalyticsAddItem:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
  99. //应用内支付-成功支付订单
  100. - (void)TDAnalyticsOnPlaceOrder:(NSString *)profileID order:(TalkingDataOrder *)order;
  101. ///csj广告
  102. //1.初始化
  103. - (void)CSJAdSDKinit;
  104. //.打开全屏广告
  105. -(void)openBUDFullScreenVideoAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  106. //新插屏广告(新增)
  107. -(void)openBUDNewInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  108. //2.打开开屏广告
  109. -(void)openBUDSplashAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  110. //3. 打开插屏广告
  111. -(void)openBUDInterstitialAd:(NSString *)adName width:(CGFloat)w Height:(CGFloat)h callback:(void (^)(BOOL))callback;
  112. //4. 打开视频激励广告
  113. -(void)openBUDExpressRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
  114. //5.1 打开原生Banner广告
  115. -(void)openBUDNativeBannerAd:(NSString *)adName WithX:(CGFloat)x Y:(CGFloat)y Width:(CGFloat)w Height:(CGFloat)h callback:(void (^)(BOOL))callback;
  116. //5.2 关闭Banner广告
  117. -(void)closeBUDBannerAd:(NSString *)adName;
  118. //6. 打开原生广告
  119. -(void)openBUDNativeAd:(NSString *)adName WidthCGRect:(CGRect)rect BUSize:(NSInteger)size callback:(void (^)(BOOL))callback;
  120. ///优量汇广告
  121. //初始化
  122. -(void)YLHAdSDKinit;
  123. -(void)openYLHSplashAd:(NSString *)adName supportZoomoutView:(BOOL)flag callback:(void (^)(BOOL))callback;
  124. -(void)openYLHInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  125. -(void)openYLHFullScreenAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  126. -(void)openYLHExpressRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
  127. -(void)openYLHExpressBannerAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  128. -(void)openYLHExpressNativeAdWithPlacementId:(NSString *)placementId AdName:(NSString *)adName Frame:(CGRect)rect callback:(void (^)(BOOL))callback;
  129. //TopOn广告
  130. - (void)TopOnAdSDKinit;
  131. -(void)openTOPONSplashAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  132. -(void)openTOPONInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  133. -(void)openTOPONRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
  134. -(void)openTOPONExpressBannerAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  135. -(void)openTOPONNativeAdWithX:(int)x Y:(int)y width:(int)w height:(int)h adId:(NSString *)adName callback:(void (^)(BOOL))callback;
  136. //extra
  137. -(void)showHudWith:(NSString *)name;
  138. @end