Skip to content

Conversation

@andy9775
Copy link
Contributor

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'));

@andy9775 andy9775 force-pushed the custom_initial_listener branch from f0bdb0e to ce1e48f Compare August 16, 2016 20:48
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
@andy9775 andy9775 force-pushed the custom_initial_listener branch from ce1e48f to fe78fc8 Compare August 16, 2016 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant