Testing Mobile App Push Notifications

In this blog post, I’ll explore what is required to thoroughly test push notifications in mobile apps.

I’ll start by exploring the functionality behind these notifications and then provide you with the comprehensive checklist I use for testing them. The checklist covers various reception and navigation scenarios, ensuring your app always delivers a seamless user experience.

Notification Types

Mobile apps support two kinds of notifications—local and remote (push) notification types. Local notifications do not rely on an internet connection or any push notification service. Instead, they are triggered from within the app. The app’s code creates these notifications when they should be displayed and delivers them on the same device. Push notifications, however, are sent by a remote server and directed to specific devices on which the app is installed.

Sample App

Throughout the rest of this post, I’ll present a real mobile app that was built by the Trailhead team. In offline mode, when the app receives real-time data from a Bluetooth-connected device that falls outside the desired range, the app creates a local notification for the user. In online mode, the user gets remote notifications from a server creating push notifications instead.

The app also uses push notifications to inform the user when it is a specific number of days before the expiration of their paid subscription and when they are online.

For the user, there is no difference in the appearance of a local or remote notification. They all look the same on a given device, though they may differ from one mobile OS to another.

How Do Push Notifications Work?

iOS requests permission from the user to send push notifications when a user first starts interacting with the app. The user can either allow or deny these notifications.

Android 12 and earlier versions subscribe to notifications by default, and users can later choose to opt-out in the settings. However, in Android 13 and later, apps must now ask for permission from users before sending notifications, as the app’s notifications are turned off by default.

When a user installs an app and grants permission for push notifications, the operating system registers the user’s device with a push notification service (Firebase Cloud Messaging for Android or Apple Push Notification Service for iOS). The notification service generates a unique device identifier (token) which allows further communication to target that specific device.

As soon as the app receives the token from the mobile OS push platform, it can send this token to its own server for future communication. When an event occurs on the server that requires notifying the user, the server can then generate a notification using the token and send it to the notification service. The notification service, in turn, sends the push notification over the internet to the installed mobile app.

Testing Push Notifications

To thoroughly test notifications in your mobile apps, I suggest dividing the testing into two parts:

  1. Testing the reception of push notifications, and
  2. Navigating through them under specific conditions

To receive a push notification, the user must be logged into our app. The authorized user is used in the checklist provided below by default. The behavior of how the notifications are presented depends on how you handle them in your app, you can customize the behavior according to your app’s design and user experience preferences. When a user taps on a push notification, the app should open and bring the user to the relevant section or content associated with the notification.

The checklist outlines various scenarios for testing the reception of push notifications:

  1. Receiving a push notification when the application is running in the foreground.
  2. Receiving a push notification when the application is running in the background.
  3. Receiving a push notification when the application is not running.
  4. Receiving a push notification when the application is reinstalled, the device is restarted, or the operating system is updated ensures that a valid token is used.
  5. Test how the app handles push notifications when the user is using multiple devices simultaneously.
  6. Test scenarios in which the user has declined permission for the app to send notifications.
  7. Test scenarios in which the user has turned off notifications for the app.
  8. Sending push notifications when logging in with different users into the app ensures that notifications are personalized and delivered to the respective users.
  9. Sending the push notification when the app is running in offline mode. In our case, we generate local notifications during offline mode. When the user returns to online mode, we ensure they won’t receive duplicate notifications once data is sent to the server.
  10. Triggering a push notification for users who have logged out.
  11. Check if the app still shows notifications when you log out and log back in without application relaunch. If you log out, the app should stop showing any notifications, whether they are local or push notifications. This means that if the user received notifications before logging out, they should not be visible anymore after the logout. Notifications should resume once the user logs back in. 
  12. Ensure that the push notification payload content aligns with the expected format.
  13. Ensure that push notifications are displayed correctly in different languages and locales.
  14. Test the handling of silent push notifications that don’t display a message but trigger background tasks. These are notifications that don’t show a message but make the app do things in the background without interrupting the user.

Here is my list for testing proper navigation via a notification:

  1. Navigate through a push notification when the application is running in the foreground.
  2. Navigate through a push notification when the application is running in the background.
  3. Navigate through a push notification when the application is not running.
  4. Navigate through a push notification when there is no internet connection.

Summary

Push notifications serve as a quick way for apps to communicate with users who aren’t currently in the app. Testing them well is crucial to ensuring your users always receive these important notifications and can interact with them successfully, even in non-optimal scenarios.

By testing in various situations, such as when the app is open, closed, or when there’s no internet, we can identify and fix any problems that may exist and create apps that have more reliable notifications.

Related Blog Posts

We hope you’ve found this to be helpful and are walking away with some new, useful insights. If you want to learn more, here are a couple of related articles that others also usually find to be interesting:

Our Gear Is Packed and We're Excited to Explore With You

Ready to come with us? 

Together, we can map your company’s software journey and start down the right trails. If you’re set to take the first step, simply fill out our contact form. We’ll be in touch quickly – and you’ll have a partner who is ready to help your company take the next step on its software journey. 

We can’t wait to hear from you! 

Main Contact

This field is for validation purposes and should be left unchanged.

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the form below. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Montage Portal

Montage Furniture Services provides furniture protection plans and claims processing services to a wide selection of furniture retailers and consumers.

Project Background

Montage was looking to build a new web portal for both Retailers and Consumers, which would integrate with Dynamics CRM and other legacy systems. The portal needed to be multi tenant and support branding and configuration for different Retailers. Trailhead architected the new Montage Platform, including the Portal and all of it’s back end integrations, did the UI/UX and then delivered the new system, along with enhancements to DevOps and processes.

Logistics

We’ve logged countless miles exploring the tech world. In doing so, we gained the experience that enables us to deliver your unique software and systems architecture needs. Our team of seasoned tech vets can provide you with:

Custom App and Software Development

We collaborate with you throughout the entire process because your customized tech should fit your needs, not just those of other clients.

Cloud and Mobile Applications

The modern world demands versatile technology, and this is exactly what your mobile and cloud-based apps will give you.

User Experience and Interface (UX/UI) Design

We want your end users to have optimal experiences with tech that is highly intuitive and responsive.

DevOps

This combination of Agile software development and IT operations provides you with high-quality software at reduced cost, time, and risk.

Trailhead stepped into a challenging project – building our new web architecture and redeveloping our portals at the same time the business was migrating from a legacy system to our new CRM solution. They were able to not only significantly improve our web development architecture but our development and deployment processes as well as the functionality and performance of our portals. The feedback from customers has been overwhelmingly positive. Trailhead has proven themselves to be a valuable partner.

– BOB DOERKSEN, Vice President of Technology Services
at Montage Furniture Services

Technologies Used

When you hit the trails, it is essential to bring appropriate gear. The same holds true for your digital technology needs. That’s why Trailhead builds custom solutions on trusted platforms like .NET, Angular, React, and Xamarin.

Expertise

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

  • Project Management
  • Architecture
  • Web App Development
  • Cloud Development
  • DevOps
  • Process Improvements
  • Legacy System Integration
  • UI Design
  • Manual QA
  • Back end/API/Database development

We partner with businesses who need intuitive custom software, responsive mobile applications, and advanced cloud technologies. And our extensive experience in the tech field allows us to help you map out the right path for all your digital technology needs.

Our Gear Is Packed and We're Excited to Explore with You

Ready to come with us? 

Together, we can map your company’s tech journey and start down the trails. If you’re set to take the first step, simply fill out the contact form. We’ll be in touch – and you’ll have a partner who cares about you and your company. 

We can’t wait to hear from you! 

Thank you for reaching out.

You’ll be getting an email from our team shortly. If you need immediate assistance, please call (616) 371-1037.