I have a secure webView which shows the customer to Load his wallet . I pass secure information MPIN(like a one time password). There is problem with
@IBOutlet weak var loading: UIActivityIndicatorView!
@IBOutlet var lblLoading: UILabel!
@IBOutlet weak var mob_webview: UIWebView!
override func viewDidLoad()
{
super.viewDidLoad()
mob_webview.hidden = true
mob_webview.delegate=self
cmmn.createDatabase()
linkgot = cmmn.geturl()
link="http://*****************************************.jsp?"
let request = NSMutableURLRequest(URL: NSURL(string: link)!)
request.HTTPMethod = "POST"
let postString = "recharge_type=\(_catcode)&amount=\(_amountfiled_got)&mobileNo=\(cmmn.getPhoneNumber())&prePostLan=\(prePostLan)&stdCode=\(_stdCode)&accNo=\(accNo)&deduct_frm=B&rcMobileNum=\(_numberfiled_got)&mobOperator=\(_merch_code)&operator=\(_operatr)&rcType=\(_rec_type)&mpin=\(_mpin)"
request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)
let task = NSURLSession.sharedSession().dataTaskWithRequest(request) {
data, response, error in
if error != nil {
print("error=\(error)")
return
}
print("response = \(response)")
let responseString = NSString(data: data!, encoding: NSUTF8StringEncoding)
print("responseString = \(responseString)")
}
task.resume()
mob_webview.loadRequest(request)
// Do any additional setup after loading the view.
}
func webViewDidFinishLoad(webView_Pages: UIWebView)
{
mob_webview.hidden = false
loading.hidden = true
lblLoading.hidden=true
print("OK")
}
In the server ,If the user types the MPIN wrong three times, he gets blocked. This is done based on the number of wrong MPIN hits in the server. For some reason my web view makes the request twice (i.e. Calls the link which loads the request twice),even though its loaded just once.Suppose if customer enter wrong MPIN and load the web view, The link is called twice he looses 2 chances to enter correct MPIN. The android version of our APP works correctly with a similar kind of request.Any reason for it?
NSURLSession
request? how are the two related? Perhaps the webview is making one request and then you are making another request with theNSURLSession
. – Moderation