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
4520e23b
Commit
4520e23b
authored
Aug 03, 2019
by
yogevbd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix e2e
parent
1c606aaa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
RNNotifications/RCTConvert+RNNotifications.m
RNNotifications/RCTConvert+RNNotifications.m
+2
-1
example/index.ios.js
example/index.ios.js
+4
-3
No files found.
RNNotifications/RCTConvert+RNNotifications.m
View file @
4520e23b
...
...
@@ -109,7 +109,8 @@
formattedNotification
[
@"body"
]
=
RCTNullIfNil
(
content
.
body
);
formattedNotification
[
@"category"
]
=
RCTNullIfNil
(
content
.
categoryIdentifier
);
formattedNotification
[
@"thread"
]
=
RCTNullIfNil
(
content
.
threadIdentifier
);
formattedNotification
[
@"data"
]
=
[
NSDictionary
dictionaryWithDictionary
:
RCTNullIfNil
(
RCTJSONClean
(
content
.
userInfo
))];
[
formattedNotification
addEntriesFromDictionary
:[
NSDictionary
dictionaryWithDictionary
:
RCTNullIfNil
(
RCTJSONClean
(
content
.
userInfo
))]];
return
formattedNotification
;
}
...
...
example/index.ios.js
View file @
4520e23b
...
...
@@ -16,12 +16,13 @@ class NotificationsExampleApp extends Component {
};
this
.
registerNotificationEvents
();
this
.
setCategories
();
}
registerNotificationEvents
()
{
Notifications
.
events
().
registerNotificationReceived
((
notification
,
completion
)
=>
{
this
.
setState
({
notifications
:
[...
this
.
state
.
notifications
,
notification
.
data
.
link
]
notifications
:
[...
this
.
state
.
notifications
,
notification
.
link
]
});
completion
({
alert
:
true
,
sound
:
false
,
badge
:
false
});
...
...
@@ -29,7 +30,7 @@ class NotificationsExampleApp extends Component {
Notifications
.
events
().
registerRemoteNotificationOpened
((
response
,
completion
)
=>
{
this
.
setState
({
notifications
:
[...
this
.
state
.
notifications
,
`Notification Clicked:
${
response
.
notification
.
data
.
link
}
`
]
notifications
:
[...
this
.
state
.
notifications
,
`Notification Clicked:
${
response
.
notification
.
link
}
`
]
});
completion
();
...
...
@@ -87,7 +88,7 @@ class NotificationsExampleApp extends Component {
async
componentDidMount
()
{
const
initialNotification
=
await
Notifications
.
getInitialNotification
();
if
(
initialNotification
)
{
this
.
setState
({
notifications
:
[
initialNotification
.
data
.
link
,
...
this
.
state
.
notifications
]});
this
.
setState
({
notifications
:
[
initialNotification
.
link
,
...
this
.
state
.
notifications
]});
}
}
...
...
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