Closed shalehaha closed 2 years ago
@shalehaha where will this be used?
the cp
metric in Analytics request
Talked with the team implementing Analytics and since we are in Swift/native code it might be overkill to have a dedicated service to read the app state. For now, we are deferring this service in favor of just reading the app state directly [[UIApplication sharedApplication] applicationState]
.
@nporter-adbe it works for now, but I guess eventually we might still want to provide something in Services where we listen for the notifications. We can wait to see how Analytics will be implementing it.
[[UIApplication sharedApplication] applicationState]
needs to run on the main thread, it might be not easy for an extension to run it on the main thread, and after that switch back to the extension thread (Semaphore can be used here, but not elegent). Also, it is not a good practice to keep bothering the main thread unless necessary.This functionality is currently not needed by other extensions. We can reopen this if needed.
similar thing as the current
ADBSystemNotificationHandler
, but should make it cleaner.