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

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Feb 14, 2024
1 parent b18083e commit 4ca4c50
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ const isRegistered = await push.isRegisteredForRemoteNotifications();

// Listeners
push.addListener('notificationReceived', (data) => {
const uuid = data.uuid;
const kind = data.kind; // foreground, background, or opened
const payload = data.payload;
if (uuid) {
// Required to tell iOS that the push was received, if not called, the library will call this in 30 seconds
await push.onFinish(uuid);
switch (data.kind) {
case 'opened':
console.log('opened');
break;
case 'foreground':
case 'background':
console.log('foreground/background');
const { uuid } = data;
await push.onFinish(uuid);
break;
}
const { title, body } = data;
});

push.addListener('deviceTokenReceived', (token) => {});
Expand Down

0 comments on commit 4ca4c50

Please sign in to comment.