Process Flow - Notification handling in foreground
App receives notification
Is app in foreground?
No→Show system notification
Yes
Handle notification in app
Update UI or alert user
End
When a notification arrives, the app checks if it is active (foreground). If yes, it handles the notification internally without showing a system alert.