0

https://www.google.co.in/

https://en-gb.facebook.com/login/

I can opened above links successfully... But below link not opened in webView why? How to solve this problem?

https://itunes.apple.com/in/developer/whatsapp-inc/id310634000?mt=8&uo=2

- (void)viewDidLoad {
   [super viewDidLoad];
   // Do any additional setup after loading the view.

   UIWebView *webView = [[UIWebView alloc]init];
   webView.frame = self.view.frame;
   [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.urlString]]];
   [self.view addSubview:webView]; 
   NSLog(@"%@", self.urlString);
   // https://itunes.apple.com/in/developer/whatsapp-inc/id310634000?mt=8&uo=2   
 }

This self.urlString comes from server...

Antony Raphel
  • 2,036
  • 2
  • 25
  • 45
Marking
  • 184
  • 1
  • 2
  • 16

3 Answers3

1

From this Link.

Maybe for better user experience itunes links doesn't open in UIWebView as iTunes content does not have an "iTunes Preview" page on mobile - iOS automatically recognizes itunes.apple.com links and opens the store.

So if you want to open itunes link you should use SKStoreProductViewController. It opens you itunes item in your app. Follow these links to use SKStoreProductViewController

How to links to apps to app store

Documentation

Community
  • 1
  • 1
Sunny
  • 821
  • 6
  • 17
0

In ViewController.h file create an outlet

@property (strong, nonatomic) IBOutlet UIWebView *webview;

In ViewController.m file viewDidLoad

_webview.delegate = self;

[_webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@",URLSTRING FROM SEVER]]]];
Sunny
  • 821
  • 6
  • 17
karthik
  • 159
  • 9
0
NSString *fullURL = @"https://itunes.apple.com/in/developer/whatsapp-inc/id310634000?mt=8&uo=2";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_viewWeb loadRequest:requestObj];
Dishant Rajput
  • 1,329
  • 1
  • 10
  • 20