Skip to content
99tests Blog
Testing guides

How to Test Push Notifications on Android and iPhone

A practical way to test push notifications on Android and iPhone, from permission prompts and Doze to Redmi battery managers, deep links and delivery timing.

In this article
  1. What a push notification passes through before anyone sees it
  2. How to test push notifications: the short version
  3. Test the permission states first
  4. App states: open, in the background, swiped away, force-stopped
  5. Device states that delay delivery: Doze, battery saver and no network
  6. Battery managers on Redmi, Realme, Vivo and Samsung phones
  7. What the notification shows: text, language and privacy
  8. The tap: deep links and the landing screen
  9. Tokens, logout and shared phones
  10. A worked example: timing one notification on five phones
  11. How to test push notifications on a real phone, not an emulator
  12. Frequently asked questions

A pharmacy app in Indore sends "Your order is out for delivery" at 7:42 pm. On the developer's Pixel, on office Wi-Fi, the banner drops down two seconds later, and the release is signed off.

On a customer's Redmi Note 13 the same message appears at 8:31 pm, 49 minutes late, after the rider has rung the bell twice and left. On her mother's Realme Narzo 60 it never appears. Neither phone is faulty. One had been lying on a table with its screen off since lunch. On the other, the app had been swiped away.

Nothing in the app's code differs between those three phones. What differs is everything a notification passes through after the server lets go of it. This guide shows how to test push notifications on Android and iPhone so that the late and missing ones turn up before release, not in a one-star review.

What a push notification passes through before anyone sees it

A push notification is a relay with five legs. Your server hands the message to a push service: usually Firebase Cloud Messaging (FCM) on Android, and Apple Push Notification service (APNs) for every iPhone app. The service holds the message until it can reach the phone. The phone's operating system decides whether to wake up for it. The app's permission and channel settings decide whether it may be shown. Then the user taps it, and the app has to open the right screen.

A "sent" line in the server log proves only the first leg. The Firebase team lists seven possible outcomes for a message on Android: delivered, pending, collapsed, dropped because too many were pending, dropped because the app was force-stopped, dropped because the device was inactive, and expired. They add that even "delivered" does not mean the banner was shown.

LegWhat can stop or delay itWhat the tester sees
1. Server to push serviceInvalid token, wrong environment, oversized payloadSender log shows an error
2. Push service to phonePhone offline, message expired or replaced by a newer oneLate arrival, or only the last of several
3. Operating systemDoze, battery saver, manufacturer battery manager, force-stopped appArrives when the phone is picked up, or never
4. Permission and channelPermission denied, channel switched off, Do Not DisturbNothing on screen, and no error anywhere
5. The tapDeep link not handled in that app state, user logged outOpens the home screen or the wrong order

How to test push notifications: the short version

  1. Get a sender you control. A staging endpoint or script that sends one notification to one test phone and logs the send time to the second.
  2. Write down the payload. Type, priority, expiry, collapse key and deep link. You cannot judge a result without knowing what was sent.
  3. Pick the phones. At least one Redmi, one Realme or Vivo, one Samsung and one iPhone, spread across Jio, Airtel and Vi.
  4. Walk the states. Permission (not asked, allowed, denied), app (open, in the background, swiped away) and device (idle, battery saver, offline and back).
  5. Tap every notification and check the landing screen. Log the send time and the arrival time for each run.

The Firebase console can push a quick message, but Firebase's documentation notes that console sends cannot set Android-specific notification fields, so what arrives may not match your production payload. Its guide to Android message priority tests with your own sending code, or with a cURL command whose parameters match the real notification. For iPhone, Apple's Push Notifications Console sends test notifications through APNs, shows delivery logs and checks whether a push token is valid. Apple runs separate development and production servers, so confirm that the build and the sender point at the same one.

Practical rule: every push test starts with a send time written to the second. Without it, "late" is an opinion.

If you would rather start from a ready list, our free push notification test cases cover the states below case by case. If you are writing your own, the fields each case needs are in format for test cases.

Test the permission states first

A notification the user never allowed is the quietest failure of all. Nothing arrives, and nothing is logged.

Android. On Android 13 and later, a newly installed app has notifications off by default until it asks for the notification permission and the user grants it. "Allow" switches on every notification channel. "Don't allow" blocks them all, apart from a few exempt cases. If the user swipes the dialog away without choosing, the state does not change, so the app may ask again. Android's permission guide treats a second denial as permanent: after it, the system dialog stops appearing.

Test an update over the live version as well as a fresh install, and confirm that a user who had already allowed notifications is not asked again.

iPhone. Apple's documentation says the system prompts only the first time an app requests authorisation, and never again. An app can instead ask for provisional authorisation, in which case notifications arrive quietly in Notification Centre with buttons to keep them or turn them off.

StateHow to reach itWhat to check
Not yet askedFresh install on Android 13+ or iPhoneNo prompt at a random moment; the app says why before asking
DeniedTap Don't allowApp still works; its settings screen shows how to turn alerts on
Dismissed (Android)Swipe the dialog awayApp can ask again later, without nagging
Denied twice (Android)Deny on two occasionsA later tap on "Turn on alerts" opens system settings, as the dialog no longer appears
Switched off laterAllow, then turn off in system settingsApp notices on next open; sends cause no server errors
One channel off (Android)Turn off "Offers", keep "Orders"Offers hidden, order updates still shown

The denied and dismissed rows are negative cases, the kind described in positive and negative testing, and they are the rows teams skip.

App states: open, in the background, swiped away, force-stopped

Ask the developer one question before this pass: is each notification sent as a notification message or as a data message? On Android the two behave differently. With the app in the background, an FCM notification message is drawn in the system tray without the app's code being called. With the app open, it goes to the app's code, and nothing appears unless the app shows it. A data message always goes to the app's code, which has to build the notification itself.

App stateHow to set itWhat to expect
Open, on another screenStay on the cart screenWhatever the spec says: banner, in-app message or silent refresh. Agree it first
In the backgroundPress HomeNotification in the tray within seconds
Swiped awaySwipe the app off the recents screenShould still arrive. On some phones this is where delivery stops
Force-stopped (Android)Settings, Apps, Force stopNothing arrives. FCM drops messages for a force-stopped app

The force-stopped row is expected behaviour, not a bug: the Firebase post linked above says the sender can do little about it. What is worth reporting is which everyday actions put the app into that state on each phone.

On iPhone, visible alerts are shown by the system even when the app is not running. Silent background notifications, the kind used to refresh content before the user opens the app, are a different matter. Apple's documentation calls them low priority, does not guarantee delivery, advises against sending more than two or three an hour, and says a held one is discarded if the app is force quit. If a screen depends on them, test that it corrects itself when the app is opened.

Device states that delay delivery: Doze, battery saver and no network

Doze. An Android phone left unplugged, still and screen-off for a while enters Doze, which suspends network access for apps. What happens to a push then depends on its priority. According to Firebase, a normal-priority message, the default, may be delayed until the phone leaves Doze, while FCM tries to deliver a high-priority message at once and can wake a sleeping phone for it. There is a catch: if an app's high-priority messages keep failing to produce a visible notification, FCM may downgrade them to normal, judged on seven days of behaviour for each install.

So an order alert sent at normal priority can pass every test on a desk and still arrive late on a bedside table. To force Doze on a test phone, Android's documentation gives three commands:

adb shell dumpsys deviceidle force-idle
adb shell dumpsys deviceidle unforce
adb shell dumpsys battery reset

Run the first, send the notification and note the arrival time, then run the other two. Without a cable, leave the phone unplugged, untouched and screen-off over lunch, and send before anyone picks it up.

Offline and back. FCM keeps a pending message until the phone reconnects or the message's time to live runs out, which is four weeks unless the sender sets less. It holds at most 100 pending messages for one install, and a newer message with the same collapse key replaces an older one. APNs is stricter: for an offline iPhone it stores one notification per app, in most cases the latest. Send three order updates to an iPhone in flight mode and expect only one when it reconnects. That is by design, which means the app must fetch the true state from the server when it opens, not rebuild it from notifications.

Expiry. "Your rider is 2 minutes away" is worse than nothing when it arrives 40 minutes later. Both services let the sender set an expiry, and a value of zero means one attempt with nothing stored. For each time-bound notification, ask what expiry is set. Then send it to a phone in flight mode, wait past the expiry and reconnect. Nothing should arrive.

Everything else. Battery saver, data saver (Low Data Mode on iPhone), Do Not Disturb or Focus, and one bar of signal each get a row on the sheet. Compare the arrival time with the normal run. The network rows are covered in the Jio and Airtel test.

Battery managers on Redmi, Realme, Vivo and Samsung phones

Stock Android's rules are only half the story. The site Don't kill my app tracks manufacturers whose software, it says, puts battery life ahead of apps working properly. Its list includes Xiaomi, Samsung, Oppo, Vivo and Realme, the brands on the shelf of any Indian phone shop. Of Xiaomi's software it says background processing does not work right at default settings, and it lists what a user has to change: background autostart, the app battery saver set to "No restriction", and locking the app in the recents screen.

No customer does that for a pharmacy app. So run this pass twice on each phone.

  1. As shipped. Default battery settings, app opened once and swiped away, screen off for 30 minutes. Send.
  2. After allowing. Switch on autostart, remove the battery restriction and repeat.

If the first run fails and the second passes, the battery manager is the cause, and the report should name the exact settings as they are worded on that phone. The fix may not be in the notification code at all. It can be a product decision: guide the user to allow autostart for critical alerts, or back up critical messages with SMS.

Practical rule: test on the phone as the customer left it: default battery settings, app swiped away, screen off. A whitelisted test phone proves very little.

Which models to put on the bench is covered in 5 parameters for choosing devices.

What the notification shows: text, language and privacy

Delivery is half the test. The other half is what the user reads on a lock screen in one glance.

  • Length. Check the title and body collapsed and expanded, on a small screen and at the largest system font. The order number should not be the part that gets cut off.
  • Language. Send Hindi, Tamil and Bengali text and check that conjuncts and vowel signs render. Confirm which setting decides the language: the app's or the phone's.
  • Placeholders. "Hi FIRST_NAME" must never reach a phone. Test an account with no name saved.
  • Sound and importance. On Android 8.0 and later every notification belongs to a channel, and the channel's importance decides whether it makes a sound or drops down as a heads-up banner. Once the channel exists, only the user can change that.
  • Privacy. Read each notification as a stranger holding the locked phone would. Medicine names, loan amounts and OTPs do not belong on a lock screen in full.

One limit deserves a deliberate test. APNs caps a notification payload at 4 KB. A Hindi character takes three bytes in UTF-8 where an English letter takes one, so a long regional-language message with a deep link and an image URL reaches the limit much sooner. Send your longest real message in every language you support.

A notification that arrives and opens the wrong screen has still failed. Test the tap from every starting state.

Starting stateExpected on tap
App open on another screenGoes to the order; Back returns to where the user was
App in the backgroundOpens the order, not the home screen
App swiped awayCold start, then the order
Logged outLogin first, then the order
Order cancelled or offer expiredA clear message, not a blank screen

Here is one failure from that table, filed properly.

Title: Tapping "Out for delivery" notification opens Home instead of the order after the app is swiped away (Galaxy A15)

  • Build: 3.8.0 (412), Android
  • Device and network: Samsung Galaxy A15, One UI, Airtel 4G
  • Starting state: Logged in, order #48213 placed, app swiped away from recents

Steps to reproduce:

  1. Trigger the "Out for delivery" notification for order #48213 from staging.
  2. Wait for the notification to appear on the lock screen.
  3. Unlock the phone and tap the notification.
  • Expected: App opens on the tracking screen for order #48213.
  • Actual: App opens on Home. The order is two taps away under My orders.
  • Reproducibility: 4 of 4 after a swipe-away. 0 of 4 with the app in the background.
  • Evidence: Screen recording with the clock visible, and the sender log line with the send time.

The reproducibility line tells the developer the deep link is lost only on a cold start. Writing reports this way is covered in steps to reproduce a bug, and the full set of fields is in our bug report template.

Tokens, logout and shared phones

Every install of the app has a push token, and the server keeps a map of tokens to accounts. Mistakes in that map are privacy bugs, and a phone shared within a family finds them quickly.

  • Logout. Log out, then trigger a notification for that account. Nothing should arrive.
  • Account switch. Log in as a second user on the same phone. The first user's salary credit or order update must not appear.
  • Reinstall. Uninstall, reinstall and log in. Notifications resume, with no duplicates.

Stale tokens also waste sends. The Firebase team estimates that apps which do not manage their tokens are likely to have 15% of messages dropped because they are addressed to inactive devices. Ask how old tokens are cleaned up, and how the delivery rate is measured.

A worked example: timing one notification on five phones

The payload is the pharmacy's "Out for delivery" alert, sent at high priority with a 30-minute expiry. Send times come from the staging log. Arrival times come from a screen recording with the clock showing seconds. The sheet below is illustrative, but it is the shape every run should produce.

PhoneNetworkState at sendSentArrivedResult
Redmi Note 13, HyperOSJio 4GApp in background, screen on11:02:1011:02:133 s
Redmi Note 13, HyperOSJio 4GSwiped away, default battery settings11:10:00Not in 30 minFail
Realme Narzo 60Airtel 4GIdle and screen off for 2 hours13:15:3013:15:366 s
Galaxy A15, One UIVi 4G, one barBattery saver on11:20:0511:20:1914 s
Vivo Y28Wi-FiFlight mode until 11:40:4011:30:0011:40:422 s after reconnect
iPhone 13Airtel 5GLocked, Focus on11:45:1011:45:122 s, silent

Three habits make a sheet like this useful. Set a pass mark for each type of notification before testing, for example 10 seconds for a transaction alert on an awake phone. Run each row three times and write "2 of 3", because one clean run hides an intermittent failure. And re-run a failed row after changing one setting, so the report can say what made the difference.

How to test push notifications on a real phone, not an emulator

An emulator is useful for the last two legs. It shows what the notification looks like and where the tap lands. It runs a stock Android image, though, with no manufacturer battery manager, no Jio tower at one bar and no afternoon spent idle on a table. The legs where notifications get lost are legs an emulator does not have. The wider differences are laid out in emulator vs real device testing.

For each run on a real phone, record the model, OS version and manufacturer skin, the battery and autostart settings, the app state, the network, and the send and arrival times. A screen recording with the clock visible is the evidence.

Before each release a short regression set is enough: the permission prompt on a fresh install, one transactional notification in each app state on one Redmi and one iPhone, and the tap from a cold start. Run the full matrix when the notification code or the push provider changes. Alerts that carry money information, such as the pre-debit alert in UPI AutoPay mandates, deserve the full matrix every time.

Frequently asked questions

Why do push notifications arrive late on some Android phones? Usually for one of three reasons: the message was sent at normal priority and the phone was in Doze, the manufacturer's battery manager restricted the app, or the phone was offline. A timing sheet separates them if you change one condition per run.

Why did only one notification arrive when the iPhone came back online? APNs stores a single notification per app for an offline device, usually the latest. The app should load the current state from the server when it opens.

Can push notifications be tested on an emulator? For layout, text and tap handling, yes. For delivery under battery savers, manufacturer skins and real mobile networks, no. Use a real phone for anything that involves time.

When should the app ask for notification permission? Apple's guidance is to ask in a context that helps people see why, for example after the first order is placed. On Android 13 and later the app controls the timing too. A prompt on the splash screen gives the user no reason to say yes.


Push notifications fail on the phones your customers carry, in the state those customers leave them in. 99tests runs your test cases on tester-owned Redmi, Realme, Galaxy, Vivo and iPhone handsets on Jio, Airtel and Vi, and a reviewer verifies every finding before it reaches you, with steps, expected and actual results, environment details and a screenshot or recording. Start from the free test case library, which has 950 cases across 25 flows, or read a sample report.