Showing
5 changed files
with
53 additions
and
0 deletions
... | @@ -86,6 +86,7 @@ | ... | @@ -86,6 +86,7 @@ |
86 | - (void)getPacingDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 86 | - (void)getPacingDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
87 | - (void)cosmoteSharingAsync:(NSString*)sharingId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 87 | - (void)cosmoteSharingAsync:(NSString*)sharingId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
88 | - (void)cosmoteRetrieveSharingAsync:(NSString*)sharingId :(NSNumber*)accept :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 88 | - (void)cosmoteRetrieveSharingAsync:(NSString*)sharingId :(NSNumber*)accept :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
89 | +- (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | ||
89 | 90 | ||
90 | @end | 91 | @end |
91 | #endif /* MyApi_h */ | 92 | #endif /* MyApi_h */ | ... | ... |
... | @@ -1418,4 +1418,17 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; | ... | @@ -1418,4 +1418,17 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; |
1418 | }]; | 1418 | }]; |
1419 | } | 1419 | } |
1420 | 1420 | ||
1421 | +- (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure | ||
1422 | +{ | ||
1423 | + [[Warply sharedService] getCosmoteUserWithSuccessBlock:guid :^(NSDictionary *response) { | ||
1424 | + if (success) { | ||
1425 | + success(response); | ||
1426 | + } | ||
1427 | + } failureBlock:^(NSError *error) { | ||
1428 | + if (failure) { | ||
1429 | + failure(error); | ||
1430 | + } | ||
1431 | + }]; | ||
1432 | +} | ||
1433 | + | ||
1421 | @end | 1434 | @end | ... | ... |
... | @@ -352,6 +352,8 @@ WL_VERSION_INTERFACE() | ... | @@ -352,6 +352,8 @@ WL_VERSION_INTERFACE() |
352 | 352 | ||
353 | - (void)verifyTicketWithSuccessBlock:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 353 | - (void)verifyTicketWithSuccessBlock:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
354 | 354 | ||
355 | +- (void)getCosmoteUserWithSuccessBlock:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | ||
356 | + | ||
355 | - (void)addAddressWithSuccessBlock:(NSString*)friendlyName :(NSString*)addressName :(NSString*)addressNumber :(NSString*)postalCode :(NSNumber*)floorNumber :(NSString*)doorbel :(NSString*)region :(NSString*)latitude :(NSString*)longitude :(NSString*)notes :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 357 | - (void)addAddressWithSuccessBlock:(NSString*)friendlyName :(NSString*)addressName :(NSString*)addressNumber :(NSString*)postalCode :(NSNumber*)floorNumber :(NSString*)doorbel :(NSString*)region :(NSString*)latitude :(NSString*)longitude :(NSString*)notes :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
356 | 358 | ||
357 | - (void)getAddressWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 359 | - (void)getAddressWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -2819,4 +2819,41 @@ public class swiftApi { | ... | @@ -2819,4 +2819,41 @@ public class swiftApi { |
2819 | } | 2819 | } |
2820 | } | 2820 | } |
2821 | 2821 | ||
2822 | + | ||
2823 | + public func getCosmoteUserAsync(guid: String, _ getCosmoteUserCallback: @escaping (_ responseData: GenericResponseModel?) -> Void) -> Void { | ||
2824 | + | ||
2825 | + let instanceOfMyApi = MyApi() | ||
2826 | + instanceOfMyApi.getCosmoteUserAsync(guid, requestCallback, failureBlock: requestFailureCallback) | ||
2827 | + | ||
2828 | + func requestCallback(_ responseData: [AnyHashable: Any]?) -> Void { | ||
2829 | + | ||
2830 | + if let responseDataDictionary = responseData as? [String: AnyObject] { | ||
2831 | + if (responseDataDictionary["status"] as? Int == 1) { | ||
2832 | + if let responseDataDictionary = responseData as? [String: Any] { | ||
2833 | + | ||
2834 | + let tempResponse = GenericResponseModel(dictionary: responseDataDictionary) | ||
2835 | + getCosmoteUserCallback(tempResponse); | ||
2836 | + | ||
2837 | + } else { | ||
2838 | + getCosmoteUserCallback(nil) | ||
2839 | + } | ||
2840 | + | ||
2841 | + } else { | ||
2842 | + getCosmoteUserCallback(nil) | ||
2843 | + } | ||
2844 | + | ||
2845 | + } else { | ||
2846 | + getCosmoteUserCallback(nil) | ||
2847 | + } | ||
2848 | + | ||
2849 | + } | ||
2850 | + | ||
2851 | + func requestFailureCallback(_ error: Error?) -> Void { | ||
2852 | + print("getCosmoteUser error: ") | ||
2853 | + print(error) | ||
2854 | + print("====================") | ||
2855 | + getCosmoteUserCallback(nil) | ||
2856 | + } | ||
2857 | + } | ||
2858 | + | ||
2822 | } | 2859 | } | ... | ... |
-
Please register or login to post a comment