Manos Chorianopoulos

add logout function

......@@ -822,6 +822,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
[_db executeUpdate:@"DROP TABLE requestVariables"];
NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
NSLog(@"**************** WARPLY Logout *****************" );
return successResponse;
}
......
......@@ -5356,4 +5356,26 @@ public class swiftApi {
}
public func logout(_ logoutCallback: @escaping (_ responseData: VerifyTicketResponseModel?) -> Void) -> Void {
let instanceOfMyApi = MyApi()
let responseData = instanceOfMyApi.logout() as [AnyHashable: Any]?
if let responseDataDictionary = responseData as? [String: Any] {
let tempResponse = VerifyTicketResponseModel(dictionary: responseDataDictionary)
if (tempResponse.getStatus == 1) {
swiftApi().setUserTag("")
swiftApi().setUserNonTelco(false)
}
logoutCallback(tempResponse);
} else {
logoutCallback(nil)
}
}
}
......