XenonSDK.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 "GMAdManager.h"
  17. ///
  18. /// Game SDK
  19. ///
  20. @interface XenonSDK : NSObject
  21. @property (nonatomic, strong) XSUser* user;
  22. @property (nonatomic, strong) XSConfiguration* configuration;
  23. @property (nonatomic, strong) void(^sdk_loginCallback)(id user);
  24. @property (nonatomic, strong) void(^sdk_logoutCallback)(id user);
  25. @property (nonatomic, strong) UIView* bubbleView;
  26. @property (nonatomic, strong) UIViewController* rootViewController;
  27. @property (nonatomic, strong) NSString* appId;
  28. @property (nonatomic, strong) NSString* channelId;
  29. @property (nonatomic, strong) NSString* adId;
  30. @property (nonatomic, strong) NSString* adFlag;
  31. @property (nonatomic, readonly) NSBundle* bundle;
  32. @property (nonatomic, readonly) NSString* version;
  33. @property (nonatomic, readonly) NSString* shortVersion;
  34. @property (nonatomic, readonly) NSString* model;
  35. @property (nonatomic, readonly) NSString* advertisingIdentifier;
  36. @property (nonatomic, readonly) NSString* advertisingVendor;
  37. @property (nonatomic, strong) NSString* token;
  38. /// A sington instance of SDK.
  39. + (instancetype)sharedSDK;
  40. /// Init the sdk with application code.
  41. - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
  42. /// Login the sdk.
  43. - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
  44. /// Logout the sdk.
  45. - (void)logoutWithComplete:(void (^)(void))complete;
  46. /// Logout the game and sdk.
  47. - (void)logoutWhenNotification:(void (^)(void))handler;
  48. /// Buy a product.
  49. - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
  50. /// User Center.
  51. - (void)center;
  52. /// Report role info.
  53. - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
  54. ///check In-app Purchase lost list.
  55. - (void)checkOrderStatus;
  56. ///Switch Account(切换账号)
  57. -(void)switchAccount;
  58. ///横幅广告(优先级:AdMob >> ironSource)
  59. - (void)adBanner:(NSString*)adId;
  60. ///关闭广告( banner, nativeAd)
  61. - (void)closeBanner:(NSString*)adId;
  62. ///打开原生广告
  63. -(void)openNativeAdTop:(int)top left:(int)left bottom:(int)bottom right:(int)right;
  64. ///打开视频激励广告
  65. -(void)openVideoAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  66. ///打开积分墙广告
  67. -(void)openofferWallAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  68. ///打开插页广告
  69. -(void)openInterstitialAd:(NSString *)adName callback:(void (^)(BOOL))complete;
  70. //广告是否加载好
  71. -(BOOL)isAvailableAd:(NSString *)adName;
  72. @end