Modify Notification.addListener('press', ...) to only register an on click listener. To
determine if the application was initially opened (not in background)
via a notification click create a new listener
Notification.addListener('initial',...) to handle this event.
Add a new callback to addListener which is called if the app is loaded
by the user and not by clicking a notification
Example usage:
Notification.addListener('press',
() => console.log('regular press listener'));
Notification.addListener('initial',
() => console.log('do something if app is opened with notification'),
() => console.log('do something else if app is opened normally'));
Modify Notification.addListener('press', ...) to only register an on click listener. To determine if the application was initially opened (not in background) via a notification click create a new listener Notification.addListener('initial',...) to handle this event.
Add a new callback to addListener which is called if the app is loaded by the user and not by clicking a notification
Example usage: