XenonSDK-Export.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. static UIApplication * mApplication;
  10. ///
  11. /// Game SDK
  12. ///
  13. @interface XenonSDK : NSObject
  14. ///
  15. /// A sington instance of SDK.
  16. ///
  17. + (instancetype)sharedSDK;
  18. ///
  19. /// Init the sdk with application code.
  20. /// \param parameter The parameter provided by the platform.
  21. ///
  22. /// \param complete This closure called when init complete.
  23. ///
  24. - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
  25. ///
  26. /// Login the sdk.
  27. /// \param complete This closure called when login complete.
  28. ///
  29. - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
  30. ///
  31. /// Logout the sdk.
  32. /// \param complete This closure called when logout complete.
  33. ///
  34. - (void)logoutWithComplete:(void (^)(void))complete;
  35. ///
  36. /// Logout the game and sdk.
  37. /// \param handler This closure called when user logout in web view.
  38. /// \note Warning this handler will retain in until next call this method.
  39. ///
  40. - (void)logoutWhenNotification:(void (^)(void))handler;
  41. ///
  42. /// Buy a product.
  43. /// \param parameters Payment request parameters.
  44. /// \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
  45. ///
  46. - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
  47. ///
  48. /// User Center.
  49. ///
  50. - (void)center;
  51. /// Report role info.
  52. /// \param roleName This role name.
  53. ///
  54. /// \param level This role current level.
  55. ///
  56. /// \param serverId This role current server.
  57. ///
  58. - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
  59. ///
  60. /// Login the sdk.
  61. /// \param complete This closure called when login complete.
  62. ///
  63. - (void)xautoWithComplete:(void (^)(id user, NSError* error))complete;
  64. ///banner横幅广告
  65. - (void)adBanner:(NSString*)adId;
  66. ///关闭banner横幅广告
  67. - (void)closeBanner:(NSString*)adId;
  68. ///Inner广告
  69. - (void)adInner:(NSString*)adId complete:(void (^)(int))complete;
  70. ///视频激励广告
  71. - (void)adVideo:(NSString*)adId complete:(void (^)(int))complete;
  72. /// 打开一个原生广告
  73. /// @param adId 打开广告编号
  74. -(void)adNative:(NSString *)adId x:(int)x y:(int)y w:(int)width h:(int)hight;
  75. /// 获取某一个广告位广告是否可用
  76. /// @param adName 广告位名称
  77. /// @parm callback YES:可用, NO:不可用
  78. -(void)isAdReady:(NSString *)adName callback:(void(^)(BOOL))callback;
  79. /// 打开一个广告
  80. /// @param adName 广告位名称
  81. -(void)openAd:(NSString *)adName;
  82. /// 打开一个广告 带着播放结果回调
  83. -(void)openAd:(NSString *)adName callback:(void(^)(BOOL))callback;
  84. //关闭原生广告
  85. -(void)closeNative:(NSString *)adName;
  86. ///
  87. /// 生命周期启动入口
  88. /// @param application application对象
  89. -(void)applicationDidFinishLaunching:(UIApplication *)application;
  90. /// 游戏进入后台
  91. -(void)applicationDidEnterBackground;
  92. /// 游戏进入到前台
  93. -(void)applicationWillEnterForeground;
  94. /// 游戏开始活跃运行
  95. -(void)applicationDidBecomeActive;
  96. ///手机震动
  97. -(void)iphoneVibrate;
  98. ///跳转appstore评论
  99. -(void)skipToAppsotreWithID:(NSString *)appleId;
  100. ///自动登录
  101. -(void)autoLogin;
  102. ///手动登录
  103. -(void)manualLogin;
  104. /// 统计事件1
  105. /// @param eventName 事件名称
  106. -(void)tjEvent:(NSString *)eventName;
  107. /// 统计事件2
  108. /// @param eventName 事件名称
  109. /// @param value 事件对应值
  110. -(void)tjEvent:(NSString *)eventName value:(NSString *)value;
  111. @end