Short answer
You test push notifications in three app states (foreground, background, closed), with the permission granted, denied and revoked, checking that tapping opens the right screen. You test deep links with the app installed and not installed, with the user logged in and logged out, and from different sources: email, SMS, messenger, browser. A test send to the iOS simulator takes one command, xcrun simctl push, and a deep link on Android takes adb shell am start. Do the final tests on physical devices.
Push notifications: the state matrix
| app state | what to check |
|---|---|
| foreground | the notification shows (in-app banner or system one) and doesn’t interrupt what the user is doing |
| background | the notification appears in the notification centre, tapping opens the right screen |
| closed | same as background, plus the app starts straight on the target screen |
| permission denied | the app works, doesn’t keep asking, shows how to turn notifications on |
| permission revoked in settings | no errors, the backend doesn’t treat it as a failure |
| logged-out user | notifications for the previous account don’t arrive |
| several devices | the notification reaches all the user’s devices, or as agreed |
On top of that: content with non-ASCII characters such as Polish letters, long text, an image in the notification, the badge count on the app icon, and a notification for a screen that no longer exists.
Test sends
iOS simulator, with a payload.json file:
xcrun simctl push booted com.example.app payload.json
{
"aps": { "alert": { "title": "Order shipped", "body": "Parcel 12345 is on its way" } },
"screen": "order",
"orderId": "12345"
}
On a physical device and on the Android emulator you send notifications through the service the app uses, usually Firebase Cloud Messaging: from the Firebase console (a test message to the device token) or from the backend on staging. The second is better, because it checks the whole path, including the server-side logic.
Deep links: what to test
| scenario | expected result |
|---|---|
| app installed, user logged in | the target screen opens with the right data |
| app installed, user logged out | login, then the target screen, not the home screen |
| app not installed | the website or the store listing |
| link from email, SMS, messenger, browser | the same behaviour everywhere |
| link with parameters, e.g. a discount code | the parameters reach the app |
| link to a resource that doesn’t exist | a clear message instead of a blank screen |
On Android you can fire a deep link without tapping anything:
adb shell am start -W -a android.intent.action.VIEW -d "https://example.com/order/12345" com.example.app
On the iOS simulator: xcrun simctl openurl booted "https://example.com/order/12345".
Universal Links and App Links
For an ordinary https URL to open the app:
- iOS: an
apple-app-site-associationfile under/.well-known/on the domain, reachable without redirects, with the correct app identifier; - Android: an
assetlinks.jsonfile under/.well-known/with the fingerprint of the certificate the app is signed with.
The most common bug: the file for the test build has the test certificate’s fingerprint, while the store app is signed with a different one. It works on staging, and on production links open the browser. Check both files after any change of domain, redirects or certificate.
How I can help
Notifications and deep links are points 28-31 in the mobile app pre-launch checklist. I check them as part of mobile testing on physical iOS and Android devices, together with the rest of a pre-launch review for PLN 6,000-10,000 net. Describe your app in the contact form.