Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Feb 10, 2024
1 parent 9db5adc commit f398aed
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ import push from '@candlefinance/push';
const isGranted = await push.requestPermissions();

// Get the APNS token w/o showing permission, useful if you want silent push notifications
await registerForToken();
await push.registerForToken();

// Check permission status: 'granted', 'denied', or 'notDetermined'
const status = await getAuthorizationStatus();
const status = await push.getAuthorizationStatus();

// listeners
// Listeners
push.addListener('notificationReceived', (data) => {
console.log('notificationReceived', data);
const uuid = data.uuid;
const kind = data.kind; // foreground, background, or opened
const payload = data.payload;
if (uuid) {
// Required push notification to tell iOS that the push was received, if not called, we will call this in 30 seconds
// Required to tell iOS that the push was received, if not called, the library will call this in 30 seconds
await push.onFinish(uuid);
}
});
Expand All @@ -72,3 +72,11 @@ return () => {
## Contributing

We are open to contributions. Please read our [Contributing Guide](CONTRIBUTING.md) for more information.

## License

This project is licensed under the terms of the [MIT license](LICENSE).

## Discord

Post in #oss channel in our [Discord](https://discord.gg/Qm7ZPUhBWV) if you have any questions or want to contribute.

0 comments on commit f398aed

Please sign in to comment.