also looking at this
feat(android): the notification cancels, and the flashlight pair deferred
#151
6 files
+303
-4
| @@ -2414,12 +2414,16 @@ class CraftBridge( | ||
| 2414 | 2414 | |
| 2415 | 2415 | @JavascriptInterface |
| 2416 | 2416 | fun cancelNotification(id: String) { |
| 2417 | if (CraftNative.cancelNotification(activity, id)) return | |
| 2418 | ||
| 2417 | 2419 | val notificationManager = activity.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager |
| 2418 | 2420 | notificationManager.cancel(id.hashCode()) |
| 2419 | 2421 | } |
| 2420 | 2422 | |
| 2421 | 2423 | @JavascriptInterface |
| 2422 | 2424 | fun cancelAllNotifications() { |
| 2425 | if (CraftNative.cancelAllNotifications(activity)) return | |
| 2426 | ||
| 2423 | 2427 | val notificationManager = activity.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager |
| 2424 | 2428 | notificationManager.cancelAll() |
| 2425 | 2429 | } |