XSNetwork.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /// Facebook login a user.
  36. + (void)loginFacebookWithToken:(NSString*)token appId:(NSString*)appid playerId:(NSString *)playerid complete:(void(^)(id object, NSError* error))complete;
  37. //Facebook bind a user
  38. +(void)bindFacebookWithToken:(NSString *)token appId:(NSString *)appid playerId:(NSString *)playerid complete:(void (^)(id, NSError *))complete;
  39. /// Apple login a user.
  40. + (void)loginApplekWithToken:(NSString*)token complete:(void(^)(id object, NSError* error))complete;
  41. /// Account & Password login a user.
  42. + (void)loginWithAccount:(NSString*)account password:(NSString*)password complete:(void(^)(id object, NSError* error))complete;
  43. /// Account & Password login a user.
  44. + (void)registerWithAccount:(NSString*)account password:(NSString*)password complete:(void(^)(id object, NSError* error))complete;
  45. /// Auto trigger;
  46. + (void)trigger:(NSInteger)count;
  47. /// Trace log.
  48. + (void)log:(NSInteger)code session:(NSString*)session extra:(NSString*)extra;
  49. + (void)reportWithUser:(NSString*)uid Name:(NSString*)name level:(NSInteger)level server:(NSString*)server;
  50. /// Get pay route.
  51. + (void)routeWithComplete:(void(^)(id object, NSError* error))complete;
  52. //#if SDK_HAS_IAP_PAYMENT
  53. /// Pay a product.
  54. + (void)payWithParameters:(id)parameters complete:(void(^)(id object, NSError* error))complete;
  55. /// Pay a product with receipt.
  56. + (void)payWithReceipt:(id)receipt orderId:(id)orderId complete:(void(^)(id object, NSError* error))complete;
  57. //#endif
  58. +(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;
  59. @end