This differential calls native api to remove all active notifications for a given thread without using additional persistence layer from redux.
Details
Add logging statement to native implementation of removeAllActiveNotificationsForThread. Build the app, put it in background. Send several notifications ensure they are present in notification center. Open the app, enter the thread notifications were sent for. Ensure they disappear and
the are logged.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/push/push-handler.react.js | ||
---|---|---|
300 | Let's avoid directly accessing NativeModules, and instead introduce a file that handles the interaction with NativeModules, and call that file from here (same as iOS) |
native/push/push-handler.react.js | ||
---|---|---|
300 | Sure. I will probably use android.js file for that. |
native/push/android.js | ||
---|---|---|
16 ↗ | (On Diff #20919) | I'm surprised Flow is okay with this!! What does it report the type of CommAndroidNotifications is? We probably need to explicitly type it, eg. like we type AndroidLifecycleModule in native/lifecycle/lifecycle-module.js |
Requesting changes for types, but let me know if there's some codegen magic already generating them or something
native/push/android.js | ||
---|---|---|
16 ↗ | (On Diff #20919) |
It reports the type is any and the type of NativeModules is { [moduleName: string]: any } |
native/push/android.js | ||
---|---|---|
16 ↗ | (On Diff #20919) | Ah yeah, we need to type this (and the iOS one) |
Please address comment before landing
native/push/android.js | ||
---|---|---|
17 ↗ | (On Diff #20977) | Is there anything else on NativeModules.CommAndroidNotifications? I think yes... if so, we should type it so |
native/push/android.js | ||
---|---|---|
17 ↗ | (On Diff #20977) | Currently no, but I will expand the scope of this type as I will be gradually adding differentials that replace subsequent react-native-firebase methods. |
native/push/android.js | ||
---|---|---|
17 ↗ | (On Diff #20977) | I am skeptical that there are no default methods on the native module, eg. getConstants. Can you modify your Test Plan to include confirming that there is only one method? You can do that via JS debugger with a debugger breakpoint, or possibly with some kind of console.log (might need to log the prototype or something though). |
Looks ok, but please make sure the types are correct.
native/push/push-handler.react.js | ||
---|---|---|
287–297 ↗ | (On Diff #20977) | It seems like we can have similar api for both platforms. Basically, we could have a method removeAllActiveNotificationsForThread implemented in a file with platform specific extension. |