Skip to content

Fix payload encoding for VoIP, PushToTalk, Complication, FileProvider, and Location notifications#245

Merged
kylebrowning merged 1 commit into
mainfrom
fix/notification-encoding
Jul 14, 2026
Merged

Fix payload encoding for VoIP, PushToTalk, Complication, FileProvider, and Location notifications#245
kylebrowning merged 1 commit into
mainfrom
fix/notification-encoding

Conversation

@kylebrowning

Copy link
Copy Markdown
Owner

These five notification types had no custom encode(to:), so the synthesized Encodable sent header metadata (topic, expiration, priority, apnsID) in the HTTP body and nested the user payload under "payload" instead of the root — contradicting each type's own documentation.

  • VoIP/PushToTalk/Complication/FileProvider now encode only the user payload at the root (same pattern as APNSBackgroundNotification).
  • Location (which has no payload) now sends a minimal {"aps":{}} body; Apple documents no body shape for location pushes.
  • Adds exact-JSON encoding tests for all five types, plus the previously missing Location topic-suffix test.

@kylebrowning
kylebrowning merged commit 12878da into main Jul 14, 2026
6 checks passed
@kylebrowning
kylebrowning deleted the fix/notification-encoding branch July 14, 2026 06:14
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.

1 participant