From c83650ba94a9b07737389e996d527e8357b82b70 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Thu, 20 Oct 2016 09:13:14 +0200 Subject: [PATCH] update doc for iOS build (#8823) --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index af1cadc..1f89f39 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,27 @@ To build a new "ready-to-publish" release, use the flag: phongap build --release Find the built releases in the `platforms/` folder. + +## iOS build + +On iOS specific code is needed to open external links. +It has to be added to *plaforms/ios/Classes/MainViewController.m* file: +``` +- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType) navigationType +{ NSURL *url = [request URL]; + // Intercept the external http requests and forward to Safari.app + // Otherwise forward to the PhoneGap WebView + if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) { [[UIApplication sharedApplication] openURL:url]; + return NO; + } else { + return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; } +} +``` + +Then, build application from XCode. + + +need specific code to add to ## License -- 2.9.3