When a Firebase Cloud Messaging (FCM) notification is sent to an Android device and the app is in the background, what happens to the notification?
Think about how Android handles notifications when the app is not active.
When the app is in the background, FCM automatically displays the notification in the system tray without running app code. This ensures the user sees the notification even if the app is not active.
You want to run custom code in the background when a notification arrives, even if the app is closed. Which Firebase service should you use?
Consider which message type allows background processing on the device.
Data messages in FCM can be handled by background services on the device, allowing custom code execution even if the app is closed.
When using Firebase Cloud Messaging data messages to handle notifications in the background, what security risk should you be aware of?
Think about data transmission security over networks.
Data messages are sent over the network and can be intercepted if not properly encrypted, risking data tampering or exposure.
To receive Firebase Cloud Messaging data messages in the background on Android, which permission must be declared in the AndroidManifest.xml?
Consider what permission allows the app to keep the device awake to process messages.
The WAKE_LOCK permission allows the app to keep the CPU awake to process incoming messages in the background.
On iOS, background notification handling is limited. Which approach best ensures your app processes notifications reliably in the background?
Think about how iOS allows apps to run code in the background.
Silent push notifications with the content-available flag allow the app to wake up in the background and process data if background fetch is enabled.