0

I am submitting user details to a local server (POST Request) which then makes a call to payment gateway called ----> PayU .Now the response that I get from local server is a url which is a url of payU and I am supposed to load it into webView.Now everything is fine till here.But the problem is that when I load this url in webView, it displays a Desktop optimised page and not a mobile optimised page.

I need to know a workaround if any from iOS end, so that I can load a mobile optimised page.For example will sending HTML form from my webView will help? Or anything else that can be done.

Here is how I load the webView currently.

NSURL *url = [NSURL URLWithString:_urlString];  //I get this url as a response of POST Request to a local server
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.paymentWebView loadRequest:request];
[self.paymentWebView scalesPageToFit];
iSD
  • 103
  • 10
  • A quick user agent switch in Chrome suggests that it does not have a mobile friendly site. Are you sure it supports mobile ? – GoodSp33d Oct 29 '14 at 08:40
  • Well if look in mobile payments tab ,it says they do https://www.payu.in/whypayu – iSD Oct 29 '14 at 08:45

1 Answers1

1

Swift

The order matters. Switching the order works for me ^^

webView.scalesPageToFit = true
webView.loadRequest(NSURLRequest(URL: NSURL(string: url)!))
Vic
  • 1,512
  • 17
  • 25