Skip to content

Conversation

@swhelan123
Copy link

@judepereira

Add support for all remaining APS and alert payload keys in Notification.Builder

This PR extends the Notification.Builder to fully support the following APNS payload fields, matching Apple’s APS and alert conventions:

Alert Enhancements

  • Full alert dictionary via alert(Object)
  • subtitle
  • launch-image
  • Localization keys/args:
    • title-loc-key, title-loc-args
    • subtitle-loc-key, subtitle-loc-args
    • loc-key, loc-args

Sound Dictionary Support

  • sound(Map<String,Object>)
  • Critical, name and volume parameters (soundCritical(), soundName(), soundVolume())

Additional APS Headers

  • thread-id
  • target-content-id
  • filter-criteria
  • stale-date
  • content-state
  • timestamp
  • event
  • dismissal-date
  • attributes-type / attributes

All new builder methods follow the project’s existing null-check and removal conventions.
Unit tests have been added to verify serialization of each new key.

Extended the Notification.Builder to support sound dictionary, additional APS headers, and alert dictionary keys for richer APNS payload customization. This includes methods for critical sound, volume, localization keys, thread ID, content state, and more.
Added unit tests to verify Notification payloads for threadId, staleDate, sound dictionary, and alert localization keys and arguments. These tests improve coverage for new builder features and ensure correct payload generation.
@francispereira
Copy link

francispereira commented Jul 14, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants