XenonSDK-Export.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. -(void)switchAccount;
  61. ///Google AM&ironSource Init
  62. - (void)GMAdSDKinit;
  63. ///横幅广告(优先级:AdMob >> ironSource)
  64. - (void)adBanner:(NSString*)adId;
  65. ///关闭广告( banner横幅, nativeAd原生)
  66. - (void)closeAd:(NSString*)adId;
  67. ///打开原生广告
  68. -(void)openNativeAdWithCenterX:(int)x Y:(int)y width:(int)w height:(int)h;
  69. ///打开视频激励广告
  70. -(void)openVideoAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  71. ///打开积分墙广告
  72. -(void)openofferWallAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  73. ///打开插页广告
  74. -(void)openInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  75. //广告是否加载好
  76. -(BOOL)isAvailableAd:(NSString *)adName;
  77. ///手机震动
  78. -(void)iphoneVibrate;
  79. ///跳转appstore评论
  80. -(void)skipToAppsotreWithID:(NSString *)appleId;
  81. ///自动登录
  82. - (void)xautoWithComplete:(void (^)(id user, NSError* error))complete;
  83. //自动登录2(不带UI界面的)
  84. //- (void)hAutoWithComplete:(void (^)(id user, NSError* error))complete;
  85. ///手动登录
  86. -(void)manualLogin;
  87. /// 统计事件1
  88. /// @param eventName 事件名称
  89. -(void)tjEvent:(NSInteger )eventName;
  90. /// 统计事件2
  91. /// @param eventName 事件名称
  92. /// @param parameters 事件对应值
  93. -(void)tjEvent:(NSInteger )eventName value:(id)parameters;
  94. @end