XenonSDK-Export.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. - (void)checkOrderStatus;
  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)switchAccount;
  62. ///自动登录
  63. - (void)xautoWithComplete:(void (^)(id user, NSError* error))complete;
  64. ///手动登录
  65. -(void)manualLogin;
  66. //提示弹窗
  67. -(void)showHudSuccess:(NSString*)str;
  68. @end