Manos Chorianopoulos

add logout function

...@@ -822,6 +822,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -822,6 +822,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
822 822
823 [_db executeUpdate:@"DROP TABLE requestVariables"]; 823 [_db executeUpdate:@"DROP TABLE requestVariables"];
824 NSDictionary *successResponse = @{@"result": @"success", @"status":@1}; 824 NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
825 + NSLog(@"**************** WARPLY Logout *****************" );
825 return successResponse; 826 return successResponse;
826 } 827 }
827 828
......
...@@ -5356,4 +5356,26 @@ public class swiftApi { ...@@ -5356,4 +5356,26 @@ public class swiftApi {
5356 } 5356 }
5357 5357
5358 5358
5359 + public func logout(_ logoutCallback: @escaping (_ responseData: VerifyTicketResponseModel?) -> Void) -> Void {
5360 +
5361 + let instanceOfMyApi = MyApi()
5362 + let responseData = instanceOfMyApi.logout() as [AnyHashable: Any]?
5363 +
5364 + if let responseDataDictionary = responseData as? [String: Any] {
5365 +
5366 + let tempResponse = VerifyTicketResponseModel(dictionary: responseDataDictionary)
5367 +
5368 + if (tempResponse.getStatus == 1) {
5369 + swiftApi().setUserTag("")
5370 + swiftApi().setUserNonTelco(false)
5371 + }
5372 +
5373 + logoutCallback(tempResponse);
5374 +
5375 + } else {
5376 + logoutCallback(nil)
5377 + }
5378 + }
5379 +
5380 +
5359 } 5381 }
......