Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write listener for initial system notifications #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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