Ver Fonte

完成Apex Mobile change password 网络请求接口,替换旧接口。
完成Apex Mobile retrieve password 网络请求接口,替换旧接口。
完成Apex Mobile logout 网络请求接口,替换旧接口。
整理去掉部分不再使用的函数。
完成Apex Mobile sendemail 网络请求接口,替换旧接口。

Ray Zhang há 6 anos atrás
pai
commit
5aba95b7a7

+ 6 - 6
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -1040,8 +1040,6 @@
 				71F67CFB19066375004E8462 /* PulldownMenu.m */,
 				712CBA0118CF38DB00C61394 /* RTLabel.h */,
 				712CBA0218CF38DB00C61394 /* RTLabel.m */,
-				719A51A318C5A4AF0080C075 /* SimpleGrid.h */,
-				719A51A418C5A4AF0080C075 /* SimpleGrid.m */,
 				71951E6D18C6A9A5005024BD /* TouchLabel.h */,
 				71951E6E18C6A9A5005024BD /* TouchLabel.m */,
 				71F67CF719065EA8004E8462 /* SimpleMenu.h */,
@@ -1053,6 +1051,12 @@
 		719A51AA18C5A60C0080C075 /* unused */ = {
 			isa = PBXGroup;
 			children = (
+				719A51A318C5A4AF0080C075 /* SimpleGrid.h */,
+				719A51A418C5A4AF0080C075 /* SimpleGrid.m */,
+				719EF8F818BB839F00EFFF5F /* ApexMobileFirstViewController.h */,
+				719EF8F918BB839F00EFFF5F /* ApexMobileFirstViewController.m */,
+				719EF8FB18BB839F00EFFF5F /* ApexMobileSecondViewController.h */,
+				719EF8FC18BB839F00EFFF5F /* ApexMobileSecondViewController.m */,
 				719A51A718C5A5D30080C075 /* SimpleGridDataSource.h */,
 				719A51A818C5A5D30080C075 /* SimpleGridDataSource.m */,
 				719A51B818C5AB7B0080C075 /* SimpleGridComponent.h */,
@@ -1282,12 +1286,8 @@
 				719EF8EF18BB839F00EFFF5F /* AppDelegate.h */,
 				719EF8F018BB839F00EFFF5F /* AppDelegate.m */,
 				715643B620198A1400B04267 /* Main.storyboard */,
-				719EF8F818BB839F00EFFF5F /* ApexMobileFirstViewController.h */,
-				719EF8F918BB839F00EFFF5F /* ApexMobileFirstViewController.m */,
 				71CEE3D518CC559B00052C63 /* ApexMobileNavigationController.h */,
 				71CEE3D618CC559B00052C63 /* ApexMobileNavigationController.m */,
-				719EF8FB18BB839F00EFFF5F /* ApexMobileSecondViewController.h */,
-				719EF8FC18BB839F00EFFF5F /* ApexMobileSecondViewController.m */,
 				427CF5CF2023F5560041472A /* NewImages.xcassets */,
 				719EF8E718BB839F00EFFF5F /* Supporting Files */,
 				71375C8D18D96EDE00EBA026 /* TabBarController.h */,

+ 46 - 0
Apex Mobile/Apex Mobile/ChangePasswordViewController.m

@@ -88,6 +88,52 @@
     
     self.mum.hidden=false;
     
+    
+    [RANetwork request_changepassword:newpass user:user oldpass:oldpass completionHandler:^(NSMutableDictionary *result) {
+        int result_code= [[result valueForKey:@"result"] intValue];
+        int ret;
+        if(result_code!=AP_USER_AUTH)
+            ret=RESULT_FALSE;
+        else
+            ret=RESULT_TRUE;
+        self.mum.hidden=true;
+        self.btnChange.enabled = true;
+        
+        if (ret==RESULT_TRUE)
+        {
+             AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            appDelegate.password = newpass;
+            [[NSUserDefaults standardUserDefaults] setValue:[AESCrypt encrypt:newpass password:@"usai"] forKey:@"password"];
+            
+
+            [self dismissViewControllerAnimated:YES completion:^{
+                
+                UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_success", nil) message:NSLocalizedString(@"alert_msg_change_success", nil)  preferredStyle:UIAlertControllerStyleAlert];
+                UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                    
+                }];
+                
+                [alertVC addAction:action];
+                
+                [appDelegate.window.rootViewController presentViewController:alertVC animated:YES completion:nil];
+                
+            }];
+        }
+        else
+        {
+            
+            UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:NSLocalizedString(@"alert_msg_failed_change_password", nil) preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                
+            }];
+            
+            [alertVC addAction:action];
+            
+            [self presentViewController:alertVC animated:YES completion:nil];
+        }
+    }];
+    return;
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         

+ 31 - 0
Apex Mobile/Apex Mobile/DetailPageViewController.m

@@ -1902,6 +1902,37 @@
     NSString *serialNo = [segment objectForKey:@"serial_no"];
     
     __weak typeof(self) weakSelf = self;
+    
+    [RANetwork request_sendemail:email CC:cc SerialNo:serialNo completionHandler:^(NSMutableDictionary *result) {
+        NSDictionary *sendResponse=result;
+        [alert dismissViewControllerAnimated:YES completion:^{
+                      
+                      if (weakSelf) {
+                          __strong typeof(weakSelf) strongSelf = weakSelf;
+                          int result = [[sendResponse objectForKey:@"result"] intValue];
+                          
+                          if (result == RESULT_TRUE) {
+                              
+                          } else {
+                              NSString *msg = [sendResponse objectForKey:@"err_msg"];
+                              if (msg == nil) {
+                                  msg = @"Sorry,something wrong";
+                              }
+                              UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:msg preferredStyle:UIAlertControllerStyleAlert];
+                              UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                                  
+                              }];
+                              [alert addAction:okAction];
+                              [strongSelf presentViewController:alert animated:YES completion:nil];
+                          }
+                          
+                      }
+                      
+                  }];
+    }];
+    
+    return;
+    
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
         NSDictionary *sendResponse = [RANetwork sendEmail:email CC:cc SerialNo:serialNo];
         dispatch_async(dispatch_get_main_queue(), ^{

+ 7 - 3
Apex Mobile/Apex Mobile/RANetwork.h

@@ -12,7 +12,7 @@
 #import "ApexMobileDB.h"
 #import "const.h"
 #import "Reachability.h"
-#import "PageData.h"
+//#import "PageData.h"
 #import "DetailContent.h"
 #import <MessageUI/MessageUI.h>
 #import <MessageUI/MFMailComposeViewController.h>
@@ -27,8 +27,8 @@
 +(NSData*)get_announcements : (NSString*) id limit: (int) limit ;
 +(NSData*)get_marketnews : (NSString*) id limit: (int) limit ;
 +(void)post_without_return : (NSString*) url parameters:(NSMutableDictionary *) params;
-+(int) get_recordcount: (NSMutableDictionary *) params ;//delegate:(id < NSURLConnectionDelegate >)delegate;
-+(PageData*) get_pagedata: (NSMutableDictionary *) params;
+//+(int) get_recordcount: (NSMutableDictionary *) params ;//delegate:(id < NSURLConnectionDelegate >)delegate;
+//+(PageData*) get_pagedata: (NSMutableDictionary *) params;
 +(DetailContent*) get_detailcontent: (NSMutableDictionary *) params;
 +(bool) IsNetworkAvailable;
 +(int) delAllMessage:(NSString*) before;
@@ -63,4 +63,8 @@
 + (DetailContent*) json2DetailContent:(NSMutableDictionary*)jsobj;
 + (void)request_orderhistory:(NSMutableDictionary *)params completionHandler:(resultHandler)result;
 + (void)request_result:(NSMutableDictionary *)params completionHandler:(resultHandler)result;
+
++(void) request_changepassword : (NSString*) newpass user:(NSString*) user oldpass:(NSString*) oldpass completionHandler:(resultHandler)result;
++(void) request_retrievepassword : (NSString*) user  email:(NSString*) email completionHandler:(resultHandler)result;
++ (void)request_sendemail:(NSString *)email CC:(NSString *)cc SerialNo:(NSString *)serialNo completionHandler:(resultHandler)result;
 @end

+ 257 - 96
Apex Mobile/Apex Mobile/RANetwork.m

@@ -561,102 +561,102 @@
     return nil;
     
 }
-+(PageData*) get_pagedata: (NSMutableDictionary *) params
-{
-    
-    DebugLog(@"get_pagedata");
-    if(![NetworkUtils IsNetworkAvailable])
-        return nil;
-    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    [params setValue:@"handset_search" forKey:@"action"];
-//    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
-    NSData* json=[self get_json:URL_REQUEST_RECORDS parameters:params  file:nil];
-    if (json==nil)
-    {
-        DebugLog(@"json is wrong");
-        return nil;
-    }
-    
-    NSError *error=nil;
-    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-    if(jsobj)
-    {
-        int result = [[jsobj valueForKey:@"result"] intValue];
-        if(result== AP_SESSION_EXPIRED)
-        {
-            [self Authorize:appDelegate.user password:appDelegate.password];
-            json=[self get_json:URL_REQUEST_RECORDS parameters:params file:nil];
-            if (json==nil)
-            {
-                DebugLog(@"json is wrong");
-                return nil;
-            }
-            jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-            result = [[jsobj valueForKey:@"result"] intValue];
-            
-        }
-        if(result!=AP_USER_AUTH)
-        {
-            DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
-            return nil;
-            
-        }
-        
-        NSDictionary* objrecords = [jsobj objectForKey:@"records"];
-        
-        PageData * pageData = [[PageData alloc] initWithRecords:objrecords];
-        return pageData;
-        
-    }
-    return nil;
-    
-}
-+(int) get_recordcount: (NSMutableDictionary *) params// delegate:(id < NSURLConnectionDelegate >)delegate
-{
-    DebugLog(@"get_recordcount");
-    if(![NetworkUtils IsNetworkAvailable])
-        return RESULT_NET_NOTAVAILABLE;
-    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    [params setValue:@"handset_search_count" forKey:@"action"];
-//    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
-    
-    NSData* json=[self get_json:URL_REQUEST_COUNT parameters:params file:nil];
-    if (json==nil)
-    {
-        DebugLog(@"json is wrong");
-        return RESULT_NET_ERROR;
-    }
-    
-    NSError *error=nil;
-    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-    if(jsobj)
-    {
-        int result = [[jsobj valueForKey:@"result"] intValue];
-        if(result== AP_SESSION_EXPIRED)
-        {
-            [self Authorize:appDelegate.user password:appDelegate.password];
-            json=[self get_json:URL_REQUEST_COUNT parameters:params file:nil];
-            if (json==nil)
-            {
-                DebugLog(@"json is wrong");
-                return RESULT_NET_ERROR;
-            }
-            jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-            result = [[jsobj valueForKey:@"result"] intValue];
-            
-        }
-        if(result!=AP_USER_AUTH)
-        {
-            DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
-            return RESULT_USERAUTH_ERROR;
-            
-        }
-        else
-            return [[jsobj valueForKey:@"count" ] intValue];
-    }
-    
-    return RESULT_ERROR;
-}
+//+(PageData*) get_pagedata: (NSMutableDictionary *) params
+//{
+//
+//    DebugLog(@"get_pagedata");
+//    if(![NetworkUtils IsNetworkAvailable])
+//        return nil;
+//    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+//    [params setValue:@"handset_search" forKey:@"action"];
+////    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
+//    NSData* json=[self get_json:URL_REQUEST_RECORDS parameters:params  file:nil];
+//    if (json==nil)
+//    {
+//        DebugLog(@"json is wrong");
+//        return nil;
+//    }
+//
+//    NSError *error=nil;
+//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//    if(jsobj)
+//    {
+//        int result = [[jsobj valueForKey:@"result"] intValue];
+//        if(result== AP_SESSION_EXPIRED)
+//        {
+//            [self Authorize:appDelegate.user password:appDelegate.password];
+//            json=[self get_json:URL_REQUEST_RECORDS parameters:params file:nil];
+//            if (json==nil)
+//            {
+//                DebugLog(@"json is wrong");
+//                return nil;
+//            }
+//            jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//            result = [[jsobj valueForKey:@"result"] intValue];
+//
+//        }
+//        if(result!=AP_USER_AUTH)
+//        {
+//            DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
+//            return nil;
+//
+//        }
+//
+//        NSDictionary* objrecords = [jsobj objectForKey:@"records"];
+//
+//        PageData * pageData = [[PageData alloc] initWithRecords:objrecords];
+//        return pageData;
+//
+//    }
+//    return nil;
+//
+//}
+//+(int) get_recordcount: (NSMutableDictionary *) params// delegate:(id < NSURLConnectionDelegate >)delegate
+//{
+//    DebugLog(@"get_recordcount");
+//    if(![NetworkUtils IsNetworkAvailable])
+//        return RESULT_NET_NOTAVAILABLE;
+//    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+//    [params setValue:@"handset_search_count" forKey:@"action"];
+////    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
+//    
+//    NSData* json=[self get_json:URL_REQUEST_COUNT parameters:params file:nil];
+//    if (json==nil)
+//    {
+//        DebugLog(@"json is wrong");
+//        return RESULT_NET_ERROR;
+//    }
+//    
+//    NSError *error=nil;
+//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//    if(jsobj)
+//    {
+//        int result = [[jsobj valueForKey:@"result"] intValue];
+//        if(result== AP_SESSION_EXPIRED)
+//        {
+//            [self Authorize:appDelegate.user password:appDelegate.password];
+//            json=[self get_json:URL_REQUEST_COUNT parameters:params file:nil];
+//            if (json==nil)
+//            {
+//                DebugLog(@"json is wrong");
+//                return RESULT_NET_ERROR;
+//            }
+//            jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//            result = [[jsobj valueForKey:@"result"] intValue];
+//            
+//        }
+//        if(result!=AP_USER_AUTH)
+//        {
+//            DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
+//            return RESULT_USERAUTH_ERROR;
+//            
+//        }
+//        else
+//            return [[jsobj valueForKey:@"count" ] intValue];
+//    }
+//    
+//    return RESULT_ERROR;
+//}
 //+(bool) IsHostAvailable : (NSString*) url
 //{
 //    Reachability *r = [Reachability reachabilityWithHostName:url];
@@ -1214,6 +1214,8 @@
 
 +(void)Logout
 {
+    return [self request_logout];
+    
     if(![NetworkUtils IsNetworkAvailable])
         return ;//RESULT_NET_NOTAVAILABLE;
     NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
@@ -2456,4 +2458,163 @@
 //
 //    return resultDic;
 }
+
+
++(void) request_changepassword : (NSString*) newpass user:(NSString*) user oldpass:(NSString*) oldpass completionHandler:(resultHandler)result
+{
+    
+//    if(![NetworkUtils IsNetworkAvailable])
+//        return RESULT_NET_NOTAVAILABLE;
+    
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    
+    
+    NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
+    [params setValue:user forKey:@"user"];
+    [params setValue:oldpass forKey:@"oldpass"];
+    [params setValue:newpass forKey:@"newpass"];
+    [params setValue:@"Change Password" forKey:@"module_name"];
+    [params setValue:@"handset_search" forKey:@"action"];
+//    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
+    
+    
+    [self request_interface:URL_RETRIEVE_PASS parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+    
+    return;
+//    NSData* json=[self get_json:URL_RETRIEVE_PASS parameters:params file:nil];
+//
+//
+//    if (json==nil)
+//    {
+//        DebugLog(@"json is wrong");
+//        return RESULT_NET_ERROR;
+//    }
+//
+//    NSError *error=nil;
+//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//    if(jsobj)
+//    {
+//        int result = [[jsobj valueForKey:@"result"] intValue];
+//        if(result== AP_SESSION_EXPIRED)
+//        {
+//            [self Authorize:appDelegate.user password:appDelegate.password];
+//            json=[self get_json:URL_RETRIEVE_PASS parameters:params file:nil];
+//            if (json==nil)
+//            {
+//                DebugLog(@"json is wrong");
+//                return RESULT_NET_ERROR;
+//            }
+//            jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//            result = [[jsobj valueForKey:@"result"] intValue];
+//
+//        }
+//        if(result!=AP_USER_AUTH)
+//        {
+//            DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
+//            return RESULT_FALSE;
+//
+//        }
+//        return RESULT_TRUE;
+//
+//    }
+//    return RESULT_NET_ERROR;
+    
+    
+}
+
+
++(void) request_retrievepassword : (NSString*) user  email:(NSString*) email completionHandler:(resultHandler)result
+{
+    
+//    if(![NetworkUtils IsNetworkAvailable])
+//        return RESULT_NET_NOTAVAILABLE;
+    NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
+    [params setValue:user forKey:@"user"];
+    [params setValue:email forKey:@"email"];
+    [params setValue:@"Retrieve Password" forKey:@"module_name"];
+    [params setValue:@"handset_search" forKey:@"action"];
+    
+    [self request_interface:URL_RETRIEVE_PASS parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+    return;
+//
+//    NSData* json=[self get_json:URL_RETRIEVE_PASS parameters:params  file:nil];
+//    if (json==nil)
+//    {
+//        DebugLog(@"json is wrong");
+//        return RESULT_NET_ERROR;
+//    }
+//
+//    NSError *error=nil;
+//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+//    if(jsobj)
+//    {
+//        int result = [[jsobj valueForKey:@"result"] intValue];
+//        if(result!=AP_USER_AUTH)
+//        {
+//            DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
+//            return RESULT_FALSE;
+//
+//        }
+//        return RESULT_TRUE;
+//
+//    }
+//    return RESULT_NET_ERROR;
+//
+//
+}
+
++(void)request_logout
+{
+//    if(![NetworkUtils IsNetworkAvailable])
+//        return ;//RESULT_NET_NOTAVAILABLE;
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.duid !=nil)
+        [params setValue:appDelegate.duid forKey:@"udid"];
+    [params setValue:@"handset_logout" forKey:@"action"];
+    
+    [self request_interface:URL_UPDATE_AUTH parameters:params err_record_url:nil completionHandler:nil retry:0];
+    return;
+//    [self post_without_return :URL_UPDATE_AUTH parameters:params];
+}
+
++ (void)request_sendemail:(NSString *)email CC:(NSString *)cc SerialNo:(NSString *)serialNo completionHandler:(resultHandler)result
+{
+    
+    if (!email) {
+        email = @"";
+    }
+    if (!serialNo) {
+        serialNo = @"";
+    }
+    
+    NSMutableDictionary *params = [NSMutableDictionary dictionary];
+    [params setObject:@"handset_search" forKey:@"action"];
+    [params setObject:@"save_communication_email" forKey:@"action_type"];
+    [params setObject:serialNo forKey:@"serial_no"];
+    [params setObject:email forKey:@"msg"];
+    
+    if (cc) {
+        [params setObject:cc forKey:@"cc"];
+    }
+    
+    [self request_interface:URL_SEND_COMM_EMAIL parameters:params err_record_url:nil completionHandler:result retry:0];
+//
+//    NSData* json=[self get_json:URL_SEND_COMM_EMAIL parameters:params  file:nil];
+//
+//    if (json==nil)
+//    {
+//        return @{
+//                 @"result" : @RESULT_NET_ERROR,
+//                 @"err_msg" : MSG_NET_ERROR
+//                 };
+//    }
+//
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil];
+//
+//    return resultDic;
+    
+}
 @end

+ 52 - 0
Apex Mobile/Apex Mobile/RetrievePasswordViewController.m

@@ -58,6 +58,58 @@
     
     self.mum.hidden=false;
     
+    
+    [RANetwork request_retrievepassword:user email:email completionHandler:^(NSMutableDictionary *result) {
+        int ret;
+        if (result==nil)
+            ret=RESULT_NET_ERROR;
+        else
+        {
+            int result_code = [[result valueForKey:@"result"] intValue];
+            if(result_code!=AP_USER_AUTH)
+                ret=RESULT_FALSE;
+            else
+                ret=RESULT_TRUE;
+        }
+        
+        self.mum.hidden=true;
+                   self.btnOk.enabled = true;
+                   self.btnCancel.enabled=true;
+                   
+                   if (ret==RESULT_TRUE)
+                   {
+                       
+                       
+                       [self dismissViewControllerAnimated:true completion:^{
+                           
+                           UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_retrieve_success", nil) message:NSLocalizedString(@"alert_msg_email_sent", nil) preferredStyle:UIAlertControllerStyleAlert];
+                           UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                               
+                           }];
+                           
+                           [alertVC addAction:action];
+                           
+                           AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+                           [appDelegate.window.rootViewController presentViewController:alertVC animated:YES completion:nil];
+                       }];
+                   }
+                   else
+                   {
+                       
+                       UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"alert_title_error", nil) message:[NSString stringWithFormat:NSLocalizedString(@"alert_msg_failed_retrieve_password", nil),ret] preferredStyle:UIAlertControllerStyleAlert];
+                       UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"ok", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                           
+                       }];
+                       
+                       [alertVC addAction:action];
+                       
+                       [self presentViewController:alertVC animated:YES completion:nil];
+                   }
+        
+    }];
+    
+    return;
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{