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
7cbf9f65
Commit
7cbf9f65
authored
Jan 23, 2017
by
Amit Davidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21: Change getInitialNotification() to work like iOS when no notif is available
parent
6cb7dd19
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
README.md
README.md
+5
-4
example/index.android.js
example/index.android.js
+1
-1
index.android.js
index.android.js
+1
-1
No files found.
README.md
View file @
7cbf9f65
...
...
@@ -105,8 +105,9 @@ import com.wix.reactnativenotifications.RNNotificationsPackage;
protected
List
<
ReactPackage
>
getPackages
()
{
return
Arrays
.<
ReactPackage
>
asList
(
new
MainReactPackage
(),
...
new
RNNotificationsPackage
(
MainApplication
.
this
),
// ...
new
RNNotificationsPackage
(
MainApplication
.
this
)
);
```
### Receiving push notifications
...
...
example/index.android.js
View file @
7cbf9f65
...
...
@@ -89,7 +89,7 @@ class MainComponent extends Component {
componentDidMount
()
{
console
.
log
(
'
ReactScreen
'
,
'
componentDidMount
'
);
PendingNotifications
.
getInitialNotification
()
.
then
((
notification
)
=>
{
console
.
log
(
"
getInitialNotification:
"
,
notification
);
this
.
setState
({
initialNotification
:
notification
.
getData
(
)});})
.
then
((
notification
)
=>
{
console
.
log
(
"
getInitialNotification:
"
,
notification
);
this
.
setState
({
initialNotification
:
(
notification
?
notification
.
getData
()
:
undefined
)});})
.
catch
((
err
)
=>
console
.
error
(
"
getInitialNotifiation failed
"
,
err
));
}
...
...
index.android.js
View file @
7cbf9f65
...
...
@@ -60,7 +60,7 @@ export class PendingNotifications {
static
getInitialNotification
()
{
return
RNNotifications
.
getInitialNotification
()
.
then
((
rawNotification
)
=>
{
return
new
NotificationAndroid
(
rawNotification
)
;
return
rawNotification
?
new
NotificationAndroid
(
rawNotification
)
:
undefined
;
});
}
}
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