0001-update-doc-for-iOS-build-8823.patch
README.md | ||
---|---|---|
174 | 174 |
phongap build --release |
175 | 175 | |
176 | 176 |
Find the built releases in the `platforms/` folder. |
177 | ||
178 |
## iOS build |
|
179 | ||
180 |
On iOS specific code is needed to open external links. |
|
181 |
It has to be added to *plaforms/ios/Classes/MainViewController.m* file: |
|
182 |
``` |
|
183 |
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType) navigationType |
|
184 |
{ NSURL *url = [request URL]; |
|
185 |
// Intercept the external http requests and forward to Safari.app |
|
186 |
// Otherwise forward to the PhoneGap WebView |
|
187 |
if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) { [[UIApplication sharedApplication] openURL:url]; |
|
188 |
return NO; |
|
189 |
} else { |
|
190 |
return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; } |
|
191 |
} |
|
192 |
``` |
|
193 | ||
194 |
Then, build application from XCode. |
|
195 | ||
196 | ||
197 |
need specific code to add to |
|
177 | 198 |
|
178 | 199 |
## License |
179 | 200 | |
180 |
- |