WebView on iOS 12 and iPhone XS, iPhone XS Max and iPhone Xr

The new iOS 12 is here and the new iPhone lineup is here too. It changed everything, that’s what Apple promised. At least it changed anything in terms of viewport, screen dimensions and interface building 😉 If you use the WebViewGold Xcode templates (or WeSetupYourWebViewApp service), you do not need to worry about this. It just

Change UserAgent in iOS WebView apps

Want to identify WebView client accesses? Makes sense, you can use it for tracking/analytics purposes and for separating web browser and WebView client accesses to optimize/modify the style or content. The default WebView UserAgent on iOS looks like this: Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile

JavaScript dialogs like alert(), confirm() and prompt() in iOS WebView apps

Want to use JavaScript dialogs like alert(), confirm() and prompt() in iOS WebView apps? They do not show up when using WKWebView element instead of UIWebView? Do not give up! Just implement this for alert(), confirm() and promt():   - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:message message:nil

Change UserAgent in Android WebView apps

Want to identify WebView client accesses? Makes sense, you can use it for tracking/analytics purposes and for separating web browser and WebView client accesses to optimize/modify the style or content. The default WebView UserAgent looks like this: Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30 (more information here). So let’s change

iOS WebView URL Handling/Open external links in Safari

Want to have a native feeling/UX in your iOS WebView app? Then you should handle external URLs differently than your regular WebView links, e.g. when clicking on a Facebook link we can open the site in Safari browser and stop loading it in WebView:   func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy)

How to build a Offline screen in iOS WebView apps

Of course, it would be great if your iOS app users would always have a 100% working WiFi or Cellular connection. But reality is different and we should know how to handle it 😉 So let’s make the best out of it and present a nice Offline screen for these annoying situations of being offline:  

WebView on iPhone X screen resolution

iPhone X is here and it changed everything. That’s what Apple promised. At least it changed anything in terms of viewport, screen dimensions and interface building 😉 If you use the WebViewGold Xcode template (or WeSetupYourWebViewApp service), you do not need to worry about this. It just looks great: Any questions? Just email us! 🙂

How To: Save image from iOS WebView to users Photos app

Sometimes it could be useful to save images to the iOS camera roll of your app user. Here is how to: Download the WebView Xcode template Define your URL (or your local HTML folder) Insert this HTML into your website: <a href="savethisimage://?url=http://www.example.org/example.png">Save this image</a> You are done! 🙂 If you want an automatic download (instead of a