// // XSNetwork.h // XenonSDK // // Created by SAGESSE on 2019/5/28. // Copyright © 2019 SAGESSE. All rights reserved. // #import @interface XSNetwork : NSObject @property (nonatomic, class) NSString* baseURL; + (void)showPrompt:(NSString*)message; + (void)showHudLoading; + (void)showHudSuccess:(id)error; + (void)showHudFailure:(id)error; + (void)hideHud; /// Make a error. + (NSError*)errorWithCode:(NSInteger)code message:(NSString*)message; + (NSDictionary*)bodyWithParameters:(id)parameters; /// Request systme configure. + (void)configureWithIdentifier:(NSString*)identifier flags:(NSString*)falgs complete:(void(^)(id object, NSError* error))complete; /// Send SMS security code. + (void)sendSMSWithPhone:(NSString*)phone type:(NSInteger)type complete:(void(^)(id object, NSError* error))complete; /// Auth login. + (void)authWithUser:(NSString*)uid complete:(void(^)(id object, NSError* error))complete ; /// Check user with phone + (void)checkWithPhone:(NSString*)phone complete:(void(^)(id object, NSError* error))complete; /// Bind user with phone. + (void)bindWithPhone:(NSString*)phone code:(NSString*)code username:(NSString*)username complete:(void(^)(id object, NSError* error))complete; /// Reset password. + (void)resetWithPhone:(NSString*)phone code:(NSString*)code password:(NSString*)password complete:(void(^)(id object, NSError* error))complete; /// Fast login a user. + (void)loginWithComplete:(void(^)(id object, NSError* error))complete; /// Phone & Security Code login a user. + (void)loginWithPhone:(NSString*)phone code:(NSString*)code complete:(void(^)(id object, NSError* error))complete; /// Account & Password login a user. + (void)loginWithAccount:(NSString*)account password:(NSString*)password complete:(void(^)(id object, NSError* error))complete; /// Account & Password login a user. + (void)registerWithAccount:(NSString*)account password:(NSString*)password complete:(void(^)(id object, NSError* error))complete; ///广告记录 +(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; /// Auto trigger; + (void)trigger:(NSInteger)count; /// Trace log. + (void)log:(NSInteger)code session:(NSString*)session extra:(NSString*)extra; + (void)reportWithUser:(NSString*)uid Name:(NSString*)name level:(NSInteger)level server:(NSString*)server; /// Get pay route. + (void)routeWithComplete:(void(^)(id object, NSError* error))complete; #if SDK_HAS_IAP_PAYMENT /// Pay a product. + (void)payWithParameters:(id)parameters complete:(void(^)(id object, NSError* error))complete; /// Pay a product with receipt. + (void)payWithReceipt:(id)receipt orderId:(id)orderId complete:(void(^)(id object, NSError* error))complete; #endif @end