on master help sign in
Allow opening of urls in web browser, email etc.
commit260aade26fca8e676c9d515cb4a38de21de26b08 authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com> dateTue 21 Feb 2017, 02:03 (10 years ago) parent56d7473
2 files changed+12
jsaddle-wkwebview/cbits-cocoa/AppDelegate.m+4 jsaddle-wkwebview/cbits-uikit/AppDelegate.m+8
jsaddle-wkwebview/cbits-cocoa/AppDelegate.m+4
@@ -60,3 +60,7 @@ void runInWKWebView(HsStablePtr handler, const char * _Nonnull progName) {
6060 }
6161}
6262
63+BOOL openApp(NSURL * url) {
64+ NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
65+ return [workspace openURL:url];
66+}
jsaddle-wkwebview/cbits-uikit/AppDelegate.m+8
@@ -55,3 +55,11 @@ void runInWKWebView(HsStablePtr handler, const char * _Nonnull progName) {
5555 }
5656}
5757
58+BOOL openApp(NSURL * url) {
59+ UIApplication *app = [UIApplication sharedApplication];
60+ if ([app canOpenURL:url]) {
61+ [app open:url];
62+ return true;
63+ }
64+ return false;
65+}