Taking Push Notification Automation to the Next Level: Handling Grouped, Context-Aware, and Dynamic Notifications
At Halodoc, push notifications are vital for seamless doctor-patient communication — from appointment requests to prescription updates.
Our earlier automation handled basic on-screen notifications. You can check that approach here.
In this blog, we share our latest advancements in iOS push notification automation — including support for grouped and ungrouped notifications, dynamic title/subtitle matching, navigation validation, and ensuring clean test states for reliable automation.
Why Accurate and Context-Aware Push Notification Automation Is Essential
As part of delivering a seamless experience to users, it's important that our automation reliably validates incoming push notifications across real-world scenarios. This includes verifying the correct notification content directly within the Notification Center(Springboard), especially when the app is not running.
Push notifications are most often received when the app is in the background or terminated, making it essential to access and validate them entirely through the Notification Center(Springboard).
Our enhanced framework introduces several key capabilities that make this possible:
- State Reset and Cleanup: Before each test run, we now clear previously received notifications from the Notification Center(Springboard). This ensures test consistency and avoids interference from older notifications.
- Dynamic Content Validation: We validate both the title and subtitle of notifications using app-type-specific rules. This ensures we're tapping exactly the right notification and that its content matches expectations.
- Grouped Notification Handling: When multiple notifications from the same app are grouped together, we expand these groups and search for the intended notification using precise label matching — increasing reliability in multi-notification scenarios.
Key Capabilities of Our Enhanced Automation
Our new approach focuses on enhancing how we detect, interact with, and validate push notifications through a well-defined sequence of actions:
- Reset Notification Center — Clear existing notifications from Springboard to ensure a clean test run.
- Triggering and Handling App-Specific Notifications — Simulate flows that generate push notifications for different app types and handle them accurately based on app context.
- Matching and Interacting with Notifications — Identify the correct notification using title and subtitle, then tap it.
- Validate the Navigation of the Notification to expected page — Confirm that the app navigates to the expected screen after tapping the notification.
Accessing the Notification Center (Springboard) to Validate Push Notifications
To validate push notifications reliably—especially when the app is in the background or terminated—we interact with them via the Notification Center (Springboard), which is iOS’s interface for displaying system notifications.
We follow two main steps to bring it into focus:
- Pull Down the Notification Center(Springboard)
We simulate a downward swipe gesture to reveal the Notification Center(Springboard), where all incoming push notifications are visible.

- Activate the Notification Center (Springboard)
Once the Notification Center(Springboard) is open, we activate its context using the bundle identifier. This enables our automation to programmatically interact with the displayed notifications. We also launch the Springboard application using its bundle identifier:

Step 1: Reset Notification Center
Once the Notification Center is expanded, we ensure a clean testing environment by clearing any previously received notifications. This prevents interference from older notifications and improves test reliability.

Step 2: Triggering and Handling App-Specific Notifications
To validate push notifications accurately, it's essential to handle how they appear for different app contexts — for example, app1
or app2
. Notifications for these apps often vary in content and structure, and those with the same group identifier will appear grouped under a common banner in the Notification Center (Springboard).
Dynamically Set Notification Context
We first determine the app context (e.g., app1
or app2
) and use that to configure:
- The group prefix, used to identify grouped notifications.
- The default title, used to match individual notifications unless explicitly overridden.

Filter Grouped Notifications
Push notifications with the same group ID will appear grouped in iOS. To ensure we target only the relevant ones, we filter grouped notifications using an app-specific prefix (e.g., APP1_GROUP
, APP2_GROUP
).

Step 3: Matching and Interacting with Notifications
Once a push notification is triggered by the app, the automation locates and interacts with it in the Notification Center (Springboard). This ensures we validate and tap the correct notification — based on both title and subtitle — just like a real user would.
Identifying the Right Notification
To make sure we interact with the intended message:
- The automation fetches all visible notifications from the Springboard.
- It compares each label against the expected title and subtitle.
- If a match is found, the notification is tapped to open it.

The flowchart below outlines how our automation locates and taps the correct push notification by handling both grouped and ungrouped types in the Notification Center(Springboard).

Step 4: Validate Navigation of Notification to expected page
After tapping the intended push notification, we verify that it successfully navigates to the correct screen in the app—whether that's a prescription detail, appointment summary, or consultation recap—based on the type of notification received.
Challenges Encountered and Our Mitigation Strategies
Bundle ID Not Exposed – Used Labels Instead
One of the initial challenges we faced was identifying push notifications specific to our app. Although using the app’s bundleIdentifier
would have been ideal, iOS’s Notification Center does not expose this information. To overcome this, we relied on the label
property instead. Since the automation framework already knows the expected notification title and subtitle, using the label allowed us to accurately locate and validate the correct notification.
Collapse Button Ambiguous – Used Scroll Logic with Label Check Instead
In iOS, grouped push notifications bundle multiple messages under a single expandable group, which can be collapsed using the “Show Less” button. Initially, we considered using this button to close the group after scrolling. However, we ran into a key limitation: the “Show Less” button appears at both the top and bottom of the group, sharing the same accessibility identifier with no reliable way to distinguish between them. This ambiguity introduced instability, as the wrong button could be tapped—sometimes collapsing the group prematurely before all notifications were evaluated.
To overcome the unreliability of the “Show Less” button in grouped notifications, we avoided using it altogether. Instead, we implemented a more stable scrolling mechanism.
Our new approach is based on tracking visible notification labels. After each scroll, we capture the labels of all currently visible notifications and compare them with the previously seen ones. If the list hasn’t changed, we assume we've reached the end of the group. This eliminates the need for tapping ambiguous UI elements and avoids redundant scrolling.
Conclusion
Our enhanced push notification automation framework has brought measurable improvements to both reliability and test coverage across different iOS app experiences. By dynamically validating content, handling grouped notifications intelligently, and leveraging Springboard interactions, we’ve established a robust, context-aware automation strategy.
This approach ensures accurate behavior validation across varied app contexts and significantly improves the overall quality of the product. With 100% of push notification validations now fully automated, manual efforts have been entirely eliminated. This has not only increased efficiency but also made our testing pipeline more consistent and dependable.
In essence, the solution is scalable, maintainable, and quality-driven — playing a critical role in strengthening our iOS automation pipeline and delivering a seamless user experience.
References
Join us
Scalability, reliability, and maintainability are the three pillars that govern what we build at Halodoc Tech. We are actively looking for engineers at all levels, and if solving hard problems with challenging requirements is your forte, please reach out to us with your resume at careers.india@halodoc.com.
About Halodoc
Halodoc is the number one all-around healthcare application in Indonesia. Our mission is to simplify and deliver quality healthcare across Indonesia, from Sabang to Merauke.
Since 2016, Halodoc has been improving health literacy in Indonesia by providing user-friendly healthcare communication, education, and information (KIE). In parallel, our ecosystem has expanded to offer a range of services that facilitate convenient access to healthcare, starting with Homecare by Halodoc as a preventive care feature that allows users to conduct health tests privately and securely from the comfort of their homes; My Insurance, which will enable users to access the benefits of cashless outpatient services more seamlessly; Chat with Doctor, which allows users to consult with over 20,000 licensed physicians via chat, video or voice call; and Health Store features that allow users to purchase medicines, supplements and various health products from our network of over 4,900 trusted partner pharmacies. To deliver holistic health solutions in a fully digital way, Halodoc offers Digital Clinic services, including Haloskin, a trusted dermatology care platform guided by experienced dermatologists.
We are proud to be trusted by global and regional investors, including the Bill & Melinda Gates Foundation, Singtel, UOB Ventures, Allianz, GoJek, Astra, Temasek, and many more. With over USD 100 million raised to date, including our recent Series D, our team is committed to building the best personalized healthcare solutions, and we remain steadfast in our journey to simplify healthcare for all Indonesians.