Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-notifications
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
冷佳娟
react-native-notifications
Commits
93f257c9
Commit
93f257c9
authored
Feb 25, 2018
by
Yedidya Kennard
Committed by
GitHub
Feb 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #182 from tiborkr/patch-1
Update notificationsEvents.md
parents
3c170df7
80a18f9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
docs/notificationsEvents.md
docs/notificationsEvents.md
+10
-6
No files found.
docs/notificationsEvents.md
View file @
93f257c9
...
...
@@ -14,9 +14,13 @@ Example:
```
javascript
constructor
()
{
NotificationsIOS
.
addEventListener
(
'
notificationReceivedForeground
'
,
this
.
onNotificationReceivedForeground
.
bind
(
this
));
NotificationsIOS
.
addEventListener
(
'
notificationReceivedBackground
'
,
this
.
onNotificationReceivedBackground
.
bind
(
this
));
NotificationsIOS
.
addEventListener
(
'
notificationOpened
'
,
this
.
onNotificationOpened
.
bind
(
this
));
this
.
_boundOnNotificationReceivedForeground
=
this
.
onNotificationReceivedForeground
.
bind
(
this
);
this
.
_boundOnNotificationReceivedBackground
=
this
.
onNotificationReceivedBackground
.
bind
(
this
);
this
.
_boundOnNotificationOpened
=
this
.
onNotificationOpened
.
bind
(
this
);
NotificationsIOS
.
addEventListener
(
'
notificationReceivedForeground
'
,
this
.
_boundOnNotificationReceivedForeground
);
NotificationsIOS
.
addEventListener
(
'
notificationReceivedBackground
'
,
this
.
_boundOnNotificationReceivedBackground
);
NotificationsIOS
.
addEventListener
(
'
notificationOpened
'
,
this
.
_boundOnNotificationOpened
);
}
onNotificationReceivedForeground
(
notification
)
{
...
...
@@ -33,9 +37,9 @@ onNotificationOpened(notification) {
componentWillUnmount
()
{
// Don't forget to remove the event listeners to prevent memory leaks!
NotificationsIOS
.
removeEventListener
(
'
notificationReceivedForeground
'
,
this
.
onNotificationReceivedForeground
.
bind
(
this
)
);
NotificationsIOS
.
removeEventListener
(
'
notificationReceivedBackground
'
,
this
.
onNotificationReceivedBackground
.
bind
(
this
)
);
NotificationsIOS
.
removeEventListener
(
'
notificationOpened
'
,
this
.
onNotificationOpened
.
bind
(
this
)
);
NotificationsIOS
.
removeEventListener
(
'
notificationReceivedForeground
'
,
this
.
_boundOnNotificationReceivedForeground
);
NotificationsIOS
.
removeEventListener
(
'
notificationReceivedBackground
'
,
this
.
_boundOnNotificationReceivedBackground
);
NotificationsIOS
.
removeEventListener
(
'
notificationOpened
'
,
this
.
_boundOnNotificationOpened
);
}
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment