XSNetwork.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // XSNetwork.h
  3. // XenonSDK
  4. //
  5. // Created by SAGESSE on 2019/5/28.
  6. // Copyright © 2019 SAGESSE. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface XSNetwork : NSObject
  10. @property (nonatomic, class) NSString* baseURL;
  11. + (void)showPrompt:(NSString*)message;
  12. + (void)showHudLoading;
  13. + (void)showHudSuccess:(id)error;
  14. + (void)showHudFailure:(id)error;
  15. + (void)hideHud;
  16. /// Make a error.
  17. + (NSError*)errorWithCode:(NSInteger)code message:(NSString*)message;
  18. + (NSDictionary*)bodyWithParameters:(id)parameters;
  19. /// Request systme configure.
  20. + (void)configureWithIdentifier:(NSString*)identifier flags:(NSString*)falgs complete:(void(^)(id object, NSError* error))complete;
  21. /// Send SMS security code.
  22. + (void)sendSMSWithPhone:(NSString*)phone type:(NSInteger)type complete:(void(^)(id object, NSError* error))complete;
  23. /// Auth login.
  24. + (void)authWithUser:(NSString*)uid complete:(void(^)(id object, NSError* error))complete ;
  25. /// Check user with phone
  26. + (void)checkWithPhone:(NSString*)phone complete:(void(^)(id object, NSError* error))complete;
  27. /// Bind user with phone.
  28. + (void)bindWithPhone:(NSString*)phone code:(NSString*)code username:(NSString*)username complete:(void(^)(id object, NSError* error))complete;
  29. /// Reset password.
  30. + (void)resetWithPhone:(NSString*)phone code:(NSString*)code password:(NSString*)password complete:(void(^)(id object, NSError* error))complete;
  31. /// Fast login a user.
  32. + (void)loginWithComplete:(void(^)(id object, NSError* error))complete;
  33. /// Phone & Security Code login a user.
  34. + (void)loginWithPhone:(NSString*)phone code:(NSString*)code complete:(void(^)(id object, NSError* error))complete;
  35. /// Account & Password login a user.
  36. + (void)loginWithAccount:(NSString*)account password:(NSString*)password complete:(void(^)(id object, NSError* error))complete;
  37. /// Account & Password login a user.
  38. + (void)registerWithAccount:(NSString*)account password:(NSString*)password complete:(void(^)(id object, NSError* error))complete;
  39. ///广告记录
  40. +(void)adRecord:(NSString *)action spaceId:(NSString *)spaceId agentName:(NSString *)agentName medium:(NSString *)medium adUnitId:(NSString *)adUnitId type:(NSString *)type unitAdId:(NSString *)unitAdId errorMsg:(NSString *)errorMeg;
  41. /// Auto trigger;
  42. + (void)trigger:(NSInteger)count;
  43. /// Trace log.
  44. + (void)log:(NSInteger)code session:(NSString*)session extra:(NSString*)extra;
  45. + (void)reportWithUser:(NSString*)uid Name:(NSString*)name level:(NSInteger)level server:(NSString*)server;
  46. /// Get pay route.
  47. + (void)routeWithComplete:(void(^)(id object, NSError* error))complete;
  48. #if SDK_HAS_IAP_PAYMENT
  49. /// Pay a product.
  50. + (void)payWithParameters:(id)parameters complete:(void(^)(id object, NSError* error))complete;
  51. /// Pay a product with receipt.
  52. + (void)payWithReceipt:(id)receipt orderId:(id)orderId complete:(void(^)(id object, NSError* error))complete;
  53. #endif
  54. @end