How would you test push notifications after a mobile app is backgrounded, killed or restarted?
Answer
Cover foreground, background, force-stopped and restarted states across supported operating-system versions, permission states and token changes. Verify delivery, deduplication, displayed content, deep-link routing, badge state and behavior when the referenced content is expired, unauthorized or already handled. Include delayed and out-of-order notifications, offline recovery and privacy checks so notification text or navigation cannot expose data on a locked or different user's device.
Strong answer includes
- covers lifecycle, permission and token-state combinations
- verifies delivery and destination behavior separately
- includes ordering, offline and privacy risks
Practical example
For example, a user force-stops the app, then a chat message push notification arrives; the tester verifies the notification still shows the correct sender name and preview, and tapping it cold-starts the app and deep-links directly into that conversation rather than the home screen. Separately, they log the user out on device B and confirm a notification meant for user A's private conversation, queued while offline, is discarded rather than displayed once device B reconnects and re-registers its push token.