XenonSDK.h 3.7 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. #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 "FqGameAd.h"
  17. #import "GMAdManager.h"
  18. #import <AudioToolbox/AudioToolbox.h>
  19. ///
  20. /// Game SDK
  21. ///
  22. @interface XenonSDK : NSObject
  23. @property (nonatomic, strong) XSUser* user;
  24. @property (nonatomic, strong) XSConfiguration* configuration;
  25. @property (nonatomic, strong) void(^sdk_loginCallback)(id user);
  26. @property (nonatomic, strong) void(^sdk_logoutCallback)(id user);
  27. @property (nonatomic, strong) UIView* bubbleView;
  28. @property (nonatomic, strong) UIViewController* rootViewController;
  29. @property (nonatomic, strong) NSString* appId;
  30. @property (nonatomic, strong) NSString* channelId;
  31. @property (nonatomic, strong) NSString* adId;
  32. @property (nonatomic, strong) NSString* adFlag;
  33. @property (nonatomic, readonly) NSBundle* bundle;
  34. @property (nonatomic, readonly) NSString* version;
  35. @property (nonatomic, readonly) NSString* shortVersion;
  36. @property (nonatomic, readonly) NSString* model;
  37. @property (nonatomic, readonly) NSString* advertisingIdentifier;
  38. @property (nonatomic, readonly) NSString* advertisingVendor;
  39. @property (nonatomic, strong) NSString* token;
  40. /// A sington instance of SDK.
  41. + (instancetype)sharedSDK;
  42. /// Init the sdk with application code.
  43. - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
  44. /// Login the sdk.
  45. - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
  46. /// Logout the sdk.
  47. - (void)logoutWithComplete:(void (^)(void))complete;
  48. /// Logout the game and sdk.
  49. - (void)logoutWhenNotification:(void (^)(void))handler;
  50. /// Buy a product.
  51. - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
  52. /// User Center.
  53. - (void)center;
  54. /// Report role info.
  55. - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
  56. ///Switch Account
  57. -(void)switchAccount;
  58. - (void)GMAdSDKinit;
  59. ///横幅广告(Google AdMob)
  60. - (void)adBanner:(NSString*)adId;
  61. ///横幅广告(IronSource)
  62. //- (void)adIronSourceBanner:(NSString*)adId;
  63. ///关闭广告( banner横幅, nativeAd原生)
  64. - (void)closeAd:(NSString*)adId;
  65. ///打开原生广告
  66. -(void)openNativeAdWithCenterX:(int)x Y:(int)y width:(int)w height:(int)h;
  67. ///打开视频激励广告
  68. -(void)openVideoAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  69. ///打开插页广告
  70. -(void)openInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  71. ///打开积分墙广告
  72. -(void)openofferWallAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  73. //广告是否加载好
  74. -(BOOL)isAvailableAd:(NSString *)adName;
  75. /// 生命周期启动入口
  76. /// @param application application对象
  77. //-(void)applicationDidFinishLaunching:(UIApplication *)application;
  78. //
  79. ///// 游戏进入后台
  80. //-(void)applicationDidEnterBackground;
  81. //
  82. ///// 游戏进入到前台
  83. //-(void)applicationWillEnterForeground;
  84. //
  85. ///// 游戏开始活跃运行
  86. //-(void)applicationDidBecomeActive;
  87. ///手机震动
  88. -(void)iphoneVibrate;
  89. ///跳转appstore评论
  90. -(void)skipToAppsotreWithID:(NSString *)appleId;
  91. ///自动登录
  92. - (void)xautoWithComplete:(void (^)(id user, NSError* error))complete;
  93. //自动登录2(不带UI界面的)
  94. - (void)hAutoWithComplete:(void (^)(id user, NSError* error))complete;
  95. ///手动登录
  96. -(void)manualLogin;
  97. /// 统计事件1
  98. /// @param eventName 事件名称
  99. -(void)tjEvent:(NSInteger )eventName;
  100. /// 统计事件2
  101. /// @param eventName 事件名称
  102. /// @param parameters 事件对应值
  103. -(void)tjEvent:(NSInteger )eventName value:(id)parameters;
  104. @end