XenonSDK-Export.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 "XSDataCenter.h"
  10. #import "TalkingData.h"
  11. ///
  12. /// Game SDK
  13. ///
  14. @interface XenonSDK : NSObject
  15. ///
  16. /// A sington instance of SDK.
  17. ///
  18. + (instancetype)sharedSDK;
  19. ///
  20. /// Init the sdk with application code.
  21. /// \param parameter The parameter provided by the platform.
  22. ///
  23. /// \param complete This closure called when init complete.
  24. ///
  25. - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
  26. ///
  27. /// Login the sdk.
  28. /// \param complete This closure called when login complete.
  29. ///
  30. - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
  31. ///
  32. /// Logout the sdk.
  33. /// \param complete This closure called when logout complete.
  34. ///
  35. - (void)logoutWithComplete:(void (^)(void))complete;
  36. ///
  37. /// Logout the game and sdk.
  38. /// \param handler This closure called when user logout in web view.
  39. /// \note Warning this handler will retain in until next call this method.
  40. ///
  41. - (void)logoutWhenNotification:(void (^)(void))handler;
  42. ///
  43. /// Buy a product.
  44. /// \param parameters Payment request parameters.
  45. /// \param complete Payment result of the callback, if the apple payment is completed before the callback, other payments will be the official launch of the callback
  46. ///
  47. - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
  48. ///
  49. /// User Center.
  50. ///
  51. - (void)center;
  52. /// Report role info.
  53. /// \param roleName This role name.
  54. ///
  55. /// \param level This role current level.
  56. ///
  57. /// \param serverId This role current server.
  58. ///
  59. - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
  60. ///自动登录
  61. - (void)hAutoWithComplete:(void (^)(id user, NSError* error))complete;
  62. ///check In-app Purchase lost list.
  63. - (void)checkOrderStatus;
  64. ///1. TalkingData 游戏运营统计
  65. - (void)TDGameOperationsinitWithAppID:(NSString *)appid ChannelId:(NSString *)channelId;
  66. ///
  67. /// Register a user for data analyzer.
  68. - (void)TDregisterWithAccount:(NSString*)account name:(NSString*)name;
  69. /// Login a user for data analyzer.
  70. - (void)TDloginWithAccount:(NSString*)account name:(NSString*)name;
  71. //report age and gender.
  72. -(void)TDreportWithAccount:(NSString*)account Name:(NSString *)name Age:(int)age Gender:(NSInteger)gender;
  73. /// report account's level and server
  74. -(void)TDreportWithAccount:(NSString*)account name:(NSString*)name level:(NSInteger)level server:(NSString*)server;
  75. //TD 充值请求,
  76. - (void)TDonChargeRequst:(NSString *)orderId
  77. iapId:(NSString *)iapId
  78. currencyAmount:(double)currencyAmount
  79. currencyType:(NSString *)currencyType
  80. virtualCurrencyAmount:(double)virtualCurrencyAmount
  81. paymentType:(NSString *)paymentType;
  82. //TD充值成功,确认玩家支付成功时调用.
  83. - (void)TDonChargeSuccess:(NSString *)orderId;
  84. //TD 自定义事件
  85. -(void)TDonEvent:(NSString *)eventId eventData:(id)parm;
  86. ///2. TalkingData 应用统计分析
  87. //Analytics init
  88. - (void)TDAnalyticsinitWithAppID:(NSString *)appid ChannelId:(NSString *)channelId backgroundSession:(BOOL)flag;
  89. ///进入页面统计(Begin和End同时调用)
  90. - (void)TDAnalyticsTrackPageBegin:(NSString *)pageName;
  91. ///离开页面统计
  92. - (void)TDAnalyticsTrackPageEnd:(NSString *)pageName;
  93. //自定义事件1,eventID:自定义事件名称
  94. - (void)TDAnalyticsTrackEvent:(NSString *)eventID;
  95. //自定义事件2,eventID:自定义事件名称, event_label:自定义事件Label,用来区分具体场景.
  96. - (void)TDAnalyticsTrackEvent:(NSString *)eventID label:(NSString *)event_label;
  97. //自定义事件3,eventID:自定义事件名称, event_label:自定义事件Label,用来区分具体场景. dict:自定义事件的参数及参数取值.
  98. - (void)TDAnalyticsTrackEvent:(NSString *)eventID label:(NSString *)event_label parameters:(NSDictionary *)dict;
  99. //应用内支付-创建订单
  100. -(TalkingDataOrder *)TDAnalyticsCreateOrder:(NSString *)orderId total:(int)total currencyType:(NSString *)currencyType;
  101. //应用内支付-添加订单详情
  102. - (TalkingDataOrder *)TDAnalyticsAddItem:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
  103. //应用内支付-成功支付订单
  104. - (void)TDAnalyticsOnPlaceOrder:(NSString *)profileID order:(TalkingDataOrder *)order;
  105. ///==================3. 穿山甲广告==================/
  106. ///3.1 初始化
  107. - (void)CSJAdSDKinit;
  108. //3.2 打开全屏广告
  109. -(void)openBUDFullScreenVideoAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  110. //3.3 打开开屏广告
  111. -(void)openBUDSplashAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  112. //3.4.1 打开新插屏广告(新增)
  113. -(void)openBUDNewInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  114. //3.4.2 打开旧版插屏广告
  115. -(void)openBUDInterstitialAd:(NSString *)adName width:(CGFloat)w Height:(CGFloat)h callback:(void (^)(BOOL))callback;
  116. //3.5 打开视频激励广告
  117. -(void)openBUDExpressRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
  118. //3.6 打开(模板)Banner广告
  119. -(void)openBUDNativeBannerAd:(NSString *)adName WithX:(CGFloat)x Y:(CGFloat)y Width:(CGFloat)w Height:(CGFloat)h callback:(void (^)(BOOL))callback;
  120. //3.7 关闭Banner广告
  121. -(void)closeBUDBannerAd:(NSString *)adName;
  122. //3.8 打开原生广告
  123. -(void)openBUDNativeAd:(NSString *)adName WidthCGRect:(CGRect)rect BUSize:(NSInteger)size callback:(void (^)(BOOL))callback;
  124. //================4.优量汇广告================/
  125. //4.1 init
  126. -(void)YLHAdSDKinit;
  127. //4.2 打开开屏广告(视频V+)
  128. -(void)openYLHSplashAd:(NSString *)adName supportZoomoutView:(BOOL)flag callback:(void (^)(BOOL))callback;
  129. //4.3 打开插屏半屏广告
  130. -(void)openYLHInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  131. //4.4 打开全屏广告
  132. -(void)openYLHFullScreenAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  133. //4.5 打开视频激励广告
  134. -(void)openYLHExpressRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
  135. //4.6 打开横幅广告
  136. -(void)openYLHExpressBannerAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  137. //4.7 打开原生广告
  138. -(void)openYLHExpressNativeAdWithPlacementId:(NSString *)placementId AdName:(NSString *)adName Frame:(CGRect)rect callback:(void (^)(BOOL))callback;
  139. //====================5.TopOn广告====================/
  140. //init
  141. - (void)TopOnAdSDKinit;
  142. //5.1 打开开屏广告
  143. -(void)openTOPONSplashAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  144. //5.2 打开插屏广告
  145. -(void)openTOPONInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  146. //5.3 打开视频激励广告
  147. -(void)openTOPONRewardedVideoAd:(NSString *)adName callback:(void (^)(BOOL,BOOL))callback;
  148. //5.4 打开横幅广告
  149. -(void)openTOPONExpressBannerAd:(NSString *)adName callback:(void (^)(BOOL))callback;
  150. //5.5 打开原生广告
  151. -(void)openTOPONNativeAdWithX:(int)x Y:(int)y width:(int)w height:(int)h adId:(NSString *)adName callback:(void (^)(BOOL))callback;
  152. //extra
  153. -(void)showHudWith:(NSString *)name;
  154. @end