also looking at this
feat(android): openURL and share — ratchet 98 -> 96
#145
6 files
+460
-3
| @@ -1412,6 +1412,8 @@ class CraftBridge( | ||
| 1412 | 1412 | |
| 1413 | 1413 | @JavascriptInterface |
| 1414 | 1414 | fun share(text: String, title: String) { |
| 1415 | if (CraftNative.share(activity, text, title)) return | |
| 1416 | ||
| 1415 | 1417 | val intent = Intent(Intent.ACTION_SEND).apply { |
| 1416 | 1418 | type = "text/plain" |
| 1417 | 1419 | putExtra(Intent.EXTRA_TEXT, text) |
| @@ -2011,6 +2013,8 @@ class CraftBridge( | ||
| 2011 | 2013 | |
| 2012 | 2014 | @JavascriptInterface |
| 2013 | 2015 | fun openURL(url: String): Boolean { |
| 2016 | if (CraftNative.openURL(activity, url)) return true | |
| 2017 | ||
| 2014 | 2018 | return try { |
| 2015 | 2019 | val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) |
| 2016 | 2020 | activity.startActivity(intent) |