Vasilis

logout call added

...@@ -301,6 +301,8 @@ WL_VERSION_INTERFACE() ...@@ -301,6 +301,8 @@ WL_VERSION_INTERFACE()
301 301
302 - (void)loginWithSuccessBlock:(NSString*)id andPassword:(NSString*)password andLoginType:(NSString*)loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 302 - (void)loginWithSuccessBlock:(NSString*)id andPassword:(NSString*)password andLoginType:(NSString*)loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
303 303
304 +- (NSDictionary*)logout;
305 +
304 - (void)webAuthorizeWithSuccessBlock:(NSDictionary*)contextResponse andId:(NSString*)id andLoginType:(NSString*)loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 306 - (void)webAuthorizeWithSuccessBlock:(NSDictionary*)contextResponse andId:(NSString*)id andLoginType:(NSString*)loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
305 307
306 - (void)tokenWithSuccessBlock:(NSDictionary*)contextResponse andClientId:(NSString*)clientId andClientSecret:(NSString*)clientSecret andLoginType:(NSString*) loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 308 - (void)tokenWithSuccessBlock:(NSDictionary*)contextResponse andClientId:(NSString*)clientId andClientSecret:(NSString*)clientSecret andLoginType:(NSString*) loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
......
...@@ -576,6 +576,14 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) ...@@ -576,6 +576,14 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
576 }]; 576 }];
577 } 577 }
578 578
579 +- (NSDictionary*)logout
580 +{
581 +
582 + [_db executeUpdate:@"DROP TABLE requestVariables"];
583 + NSDictionary *successResponse = @{@"result": @"success", @"status":@1};
584 + return successResponse;
585 +}
586 +
579 - (void)webAuthorizeWithSuccessBlock:(NSDictionary*)contextResponse andId:(NSString*)id andLoginType:(NSString*)loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 587 - (void)webAuthorizeWithSuccessBlock:(NSDictionary*)contextResponse andId:(NSString*)id andLoginType:(NSString*)loginType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
580 { 588 {
581 if ([[contextResponse objectForKey:@"status"] isEqual:@1]) { 589 if ([[contextResponse objectForKey:@"status"] isEqual:@1]) {
......
...@@ -365,6 +365,12 @@ NSString *LANG; ...@@ -365,6 +365,12 @@ NSString *LANG;
365 return resp; 365 return resp;
366 } 366 }
367 367
368 +- (NSDictionary *)logout {
369 + NSDictionary *response = [NSDictionary alloc];
370 + response = [[Warply sharedService] logout];
371 + return response;
372 +}
373 +
368 - (NSDictionary *)register:(NSString *)id password:(NSString *)password name:(NSString*)name email:(NSString*)email segmentation:(NSNumber*)segmentation newsletter:(NSNumber*)newsletter { 374 - (NSDictionary *)register:(NSString *)id password:(NSString *)password name:(NSString*)name email:(NSString*)email segmentation:(NSNumber*)segmentation newsletter:(NSNumber*)newsletter {
369 __block NSDictionary *resp = [NSDictionary alloc]; 375 __block NSDictionary *resp = [NSDictionary alloc];
370 __block BOOL isRunLoopNested = NO; 376 __block BOOL isRunLoopNested = NO;
......