Skip to content

Conversation

intrip
Copy link
Collaborator

@intrip intrip commented Sep 18, 2025

Removes the apnoticnet-http2 depencency in favor of a custom implementation using the httpx client.

Backward compatibility:

The apple_data payload now expects a format which matches exactly the APNs API. Previously, the Apnotic format was used instead.

The key differences are:

  • The field keys now use dash - as a separator instead of an underscore _.
  • The header fields can be overridden using their exact name, e.g. apns-priority instead of a custom name set by Apnotic (priority).

before:

notification = ApplicationPushNotification
  .with_apple(category: "observable", thread_id: "greeting", priority: "1")
  .new(title: "Hello world!")

after:

notification = ApplicationPushNotification
  .with_apple(aps: { category: "observable", "thread-id": "greeting"}, "apns-priority": "1")
  .new(title: "Hello world!")

There is a temporary backward-compatibility layer which takes care of the translation from the Apnotic format, but it will be removed in the next release.

See #25

@intrip intrip force-pushed the nix-apnotic branch 5 times, most recently from 24cdcf2 to 4b3ad1d Compare September 19, 2025 08:55
@intrip intrip marked this pull request as ready for review September 19, 2025 12:30
Removes the `apnotic`→`net-http2` depencency in favor of a custom implementation using the `httpx` client.

**Backward compatibility:**

The `apple_data` payload now expects a format which matches exactly the [APNs
API](https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification#Payload-key-reference).
Previously, the [Apnotic](https://github.com/ostinelli/apnotic) format was used instead.

The key differences are:

- The field keys now use dash `-` as a separator instead of an underscore `_`.
- The header fields can be overridden using their exact name, e.g.
  `apns-priority` instead of a custom name set by Apnotic (`priority`).

*before:*

```ruby
notification = ApplicationPushNotification
  .with_apple(category: "observable", thread_id: "greeting", priority: "1")
  .new(title: "Hello world!")
```

*after:*

```ruby
notification = ApplicationPushNotification
  .with_apple(aps: { category: "observable", "thread-id": "greeting"}, "apns-priority": "1")
  .new(title: "Hello world!")
```

There is a temporary backward-compatibility layer which takes
care of the translation from the Apnotic format, but it will be removed
in the next release.

See #25 (comment)
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