Skip to content

Commit 8e7bd4c

Browse files
committed
add permission change listener
1 parent c2fc898 commit 8e7bd4c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

examples/demo/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ function App() {
7373
OneSignal.Notifications.addEventListener('click', (e: NotificationClickEvent) => {
7474
log.i(TAG, `Notification click: ${e.notification.title ?? ''}`);
7575
});
76+
OneSignal.Notifications.addEventListener('permissionChange', (granted: boolean) => {
77+
log.i(TAG, `Permission changed: ${granted}`);
78+
});
7679
OneSignal.Notifications.addEventListener('foregroundWillDisplay', (e: NotificationWillDisplayEvent) => {
7780
log.i(TAG, `Notification foregroundWillDisplay: ${e.getNotification().title ?? ''}`);
7881
e.preventDefault();

0 commit comments

Comments
 (0)