How to Test Push Notifications on iOS devices?
By Jash Unadkat, Community Contributor - June 6, 2023
Push notifications are an integral part of any mobile app. They motivate users to interact with the app, increase its outreach, promote its services/functions, and keep users engaged as much as possible. They are helpful for marketing and advertising purposes.
In February 2023, approximately 31.5 thousand mobile apps were released through the Apple App Store, up by two percent compared to the previous month.
Naturally, testing and validating the appearance of iOS push notifications at regular intervals is a priority for app development and QA teams. This article will demonstrate how developers or QA can test push notifications for published and work-in-progress iOS apps on real iPhones and iPads.
Why test iOS Push Notifications online on Real Devices?
Teams often prefer using iOS simulators for testing push notifications. However, it’s a daunting task to find simulators for each device type.
Testing iOS push notifications online on real devices is crucial for several reasons:
- Verification of integration: It ensures that the integration between your app and the Apple Push Notification service (APNs) functions correctly. This confirms that the necessary certificates, configurations, and code implementations are set up accurately.
- Real-world scenarios: Allows you to replicate real user conditions your app users might encounter. Different devices, iOS versions, and slow network conditions can affect how push notifications are received and displayed. Testing with low battery levels, unstable network connections, or during different app states (foreground, background, or terminated) can uncover bugs.
- Notification appearance: Push notifications appear differently based on the iOS version, device model, and user settings. You can see how your notifications look and behave across various devices and iOS versions by testing on real devices.
Testing Push Notifications on Unpublished or Under-Development iOS Apps
To begin with testing push notifications for a work-in-progress app on a specific iOS device, follow the steps below:
1. Signup for free or purchase a specific plan for Browserstack App-Live.
2. Select the – Install via TestFlight option once the App Live dashboard opens up.
(Note: To test push notifications for apps under development, the Install via Test Flight option is mandatory).
3. Select a device to test on after clicking the Install via TestFlight option.
4. Once the device loads, log in using an existing Apple ID or create a new one.
Note: While entering the password, users cannot see the password showing up in its data field. For security reasons, Apple does not allow the password to be displayed during streaming. Don’t worry about this. Complete typing the password and proceed to Sign in.
Refer to this FAQ section to learn more about the Login process for Test Flight and AppStore.
5. Choose from the available apps in TestFlight. It will download and install the app on the selected device (iPhone 13).
6. Once the app is downloaded and installed, trigger a push notification using a service like FCM (or one preferred by the specific team). Once triggered, the push notification will show up in the notification panel.
Key Update: BrowserStack App Live now supports testing push notifications for directly uploaded apps via computer or URL with the recently launched support for iOS entitlements.
To enable iOS entitlement for an app -> Upload the app on the App-Live dashboard using the ‘Upload from computer’ or ‘Upload via URL’ option.
Once the app is uploaded, click the Gear icon next to the app listing and turn on the iOS entitlement switch.
Further, Click on the desired iOS Device from the right panel to launch a test session with iOS Entitlement testing enabled!
Remember that any other user in your team can change these settings by accessing the uploaded app on BrowserStack App Live. So one must check the App Configurations section once before launching the session to ensure that the Configurations are set according to your requirements.
Testing Push Notifications for Published iOS Apps
1. One can also download an app from App Store and test push notifications.
2. Select the Install via AppStore feature and the desired iOS device on the App Live Dashboard. Once the device loads, open the App Store and log in using the Apple ID and Two-factor authentication.
3. Once signed in, search and install the app to be tested from the App Store; For instance, Instagram will be directly downloaded from App Store and ready to be tested for Push Notifications on a real iPhone 13.
Note: Users will be prompted to enter the password of their Apple ID before downloading any particular app directly from AppStore. This is a mandatory step.
As mentioned, testing push notifications on the iOS simulator will not help achieve comprehensive test coverage. Moreover, installing and configuring simulators for each device before testing push notifications will be very time-consuming and inefficient.
Testing on real iOS devices is the best way to validate any functionality for iOS apps, as it helps yield accurate test results. Testing push notifications across real iOS devices will help teams evaluate the functionality and appearance of notifications on a wide range of iPhones and iPads in a hassle-free manner. The illustration above will help developers or individual testers easily execute push notification testing on real iOS devices.