Skip to content

Commit cabcd54

Browse files
authored
feat: Add experimental native APNs API (#547)
1 parent f48d889 commit cabcd54

12 files changed

Lines changed: 1963 additions & 5 deletions

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The official Push Notification adapter for Parse Server. See [Parse Server Push
1818
- [Installation](#installation)
1919
- [Configure Parse Server](#configure-parse-server)
2020
- [Apple Push Options](#apple-push-options)
21+
- [Native APNS (Experimental)](#native-apns-experimental)
2122
- [Android Push Options](#android-push-options)
2223
- [Firebase Cloud Messaging (FCM)](#firebase-cloud-messaging-fcm)
2324
- [Google Cloud Service Account Key](#google-cloud-service-account-key)
@@ -100,6 +101,25 @@ osx: {
100101
}
101102
```
102103

104+
#### Native APNS (Experimental)
105+
106+
As an alternative to the default APNS implementation which uses the `@parse/node-apn` library, you can enable a native APNS implementation that uses only built-in Node.js modules (`node:http2`, `node:crypto`) with zero additional dependencies. This is an experimental feature that only supports token-based authentication (`.p8` key). Certificate-based authentication (`.p12`/`.pem`) is not supported; use the default APNS implementation for that.
107+
108+
To enable the native APNS implementation, set `useNativeAPNs: true`:
109+
110+
```js
111+
ios: {
112+
useNativeAPNs: true,
113+
token: {
114+
key: __dirname + '/apns.p8',
115+
keyId: '<APNS_KEY_ID>',
116+
teamId: '<APNS_TEAM_ID>'
117+
},
118+
topic: '<BUNDLE_IDENTIFIER>',
119+
production: true
120+
}
121+
```
122+
103123
### Android Push Options
104124

105125
Delivering push notifications to Android devices can be done via Firebase Cloud Messaging (FCM):

spec/APNS.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ describe('APNS', () => {
744744
expect(result.transmitted).toBe(false);
745745
expect(result.device.deviceToken).toBe('abcd');
746746
expect(result.device.deviceType).toBe('ios');
747-
expect(result.response.error).toBe('Unkown status');
747+
expect(result.response.error).toBe('Unknown status');
748748
done();
749749
})
750750
});

0 commit comments

Comments
 (0)