WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Refactor: Merge `PushNotificationsManager` and `InteractiveNotificationsManager` into one class

Open salimbraksa opened this issue 10 months ago • 1 comments

I came across the following comment while working on this issue:

// TODO:
// =====
// Refactor both PushNotificationsManager + InteractiveNotificationsManager:
//
//  -   InteractiveNotificationsManager should no longer be a singleton. Perhaps we could convert it into a struct.
//      Plus int should probably be renamed into something more meaningful (and match the new framework's naming)
//  -   New `NotificationsManager` class:
//      -   Would inherit `PushNotificationsManager.handleNotification`
//      -   Would deal with UserNotifications.framework
//      -   Would use InteractiveNotificationsManager!
//  -   Nuke `PushNotificationsManager`
//
//

We currently have two separate classes, PushNotificationsManager and InteractiveNotificationsManager, handling aspects of push notifications which could lead to unnecessary complexity. To address this, I propose merging them into a single class named PushNotificationsManager. The goal is to make sure the new, unified class keeps all the features of the original classes, streamlining the push notifications handling in our app and making it more straightforward.

salimbraksa avatar Apr 03 '24 03:04 salimbraksa

Thanks for reporting! 👍

dangermattic avatar Apr 03 '24 03:04 dangermattic