TomGameSdk.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // TomGameSdk.h
  3. // TomGameSdk
  4. //
  5. // Created by SAGESSE on 2019/1/20.
  6. // Copyright © 2019 SAGESSE. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. ///
  10. /// Game SDK
  11. ///
  12. __attribute__((objc_runtime_name("_TtC10TomGameSdk10TomGameSdk"))) @interface TomGameSdk : NSObject
  13. ///
  14. /// A sington instance of SDK.
  15. ///
  16. + (instancetype)sharedSDK;
  17. ///
  18. /// Init the sdk with application code.
  19. /// \param parameter The parameter provided by the platform.
  20. ///
  21. /// \param complete This closure called when init complete.
  22. ///
  23. - (void)initWithParameter:(NSString*)parameter complete:(void (^)(NSError* error))complete;
  24. ///
  25. /// Login the sdk.
  26. /// \param complete This closure called when login complete.
  27. ///
  28. - (void)loginWithComplete:(void (^)(id user, NSError* error))complete;
  29. ///
  30. /// Logout the sdk.
  31. /// \param complete This closure called when logout complete.
  32. ///
  33. - (void)logoutWithComplete:(void (^)(void))complete;
  34. ///
  35. /// Logout the game and sdk.
  36. /// \param handler This closure called when user logout in web view.
  37. /// \note Warning this handler will retain in until next call this method.
  38. ///
  39. - (void)logoutWhenNotification:(void (^)(void))handler;
  40. ///
  41. /// Buy a product.
  42. /// \param parameters Payment request parameters.
  43. /// \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
  44. ///
  45. - (void)buy:(NSDictionary*)parameters complete:(void (^)(id order, NSError* error))complete;
  46. ///
  47. /// User Center.
  48. ///
  49. - (void)center;
  50. /// Report role info.
  51. /// \param roleName This role name.
  52. ///
  53. /// \param level This role current level.
  54. ///
  55. /// \param serverId This role current server.
  56. ///
  57. - (void)reportWithRoleName:(NSString*)roleName level:(NSInteger)level serverId:(NSString*)serverId;
  58. @end