Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3486813
D6379.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6379.diff
View Options
diff --git a/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java b/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java
--- a/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java
+++ b/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java
@@ -96,6 +96,11 @@
}
}
+ @ReactMethod
+ public void removeAllDeliveredNotifications() {
+ notificationManager.cancelAll();
+ }
+
@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = new HashMap<>();
diff --git a/native/push/android.js b/native/push/android.js
--- a/native/push/android.js
+++ b/native/push/android.js
@@ -15,6 +15,7 @@
) => void,
+getConstants: () => { +NOTIFICATIONS_IMPORTANCE_HIGH: number, ... },
+setBadge: (count: number) => void,
+ +removeAllDeliveredNotifications: () => void,
...
};
export type AndroidForegroundMessage = {
diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js
--- a/native/push/push-handler.react.js
+++ b/native/push/push-handler.react.js
@@ -271,7 +271,7 @@
if (Platform.OS === 'ios') {
CommIOSNotifications.removeAllDeliveredNotifications();
} else if (Platform.OS === 'android') {
- getFirebase().notifications().removeAllDeliveredNotifications();
+ CommAndroidNotifications.removeAllDeliveredNotifications();
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 6:03 AM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675614
Default Alt Text
D6379.diff (1 KB)
Attached To
Mode
D6379: Implement native method to remove all active notifications and use it in JavaScript
Attached
Detach File
Event Timeline
Log In to Comment