Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-fcm
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
ym
react-native-fcm
Commits
24c29f39
Commit
24c29f39
authored
Jun 03, 2017
by
Libin Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picture example
parent
2ed1c1b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
27 deletions
+17
-27
Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainActivity.java
...java/com/google/firebase/quickstart/fcm/MainActivity.java
+0
-0
Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainApplication.java
...a/com/google/firebase/quickstart/fcm/MainApplication.java
+0
-0
Examples/simple-fcm-client/app/App.js
Examples/simple-fcm-client/app/App.js
+2
-1
Examples/simple-fcm-client/app/PushController.js
Examples/simple-fcm-client/app/PushController.js
+15
-26
No files found.
Examples/simple-fcm-client/android/app/src/main/java/
fcm/
com/google/firebase/quickstart/fcm/MainActivity.java
→
Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainActivity.java
View file @
24c29f39
File moved
Examples/simple-fcm-client/android/app/src/main/java/
fcm/
com/google/firebase/quickstart/fcm/MainApplication.java
→
Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainApplication.java
View file @
24c29f39
File moved
Examples/simple-fcm-client/app/App.js
View file @
24c29f39
...
@@ -33,7 +33,8 @@ export default class App extends Component {
...
@@ -33,7 +33,8 @@ export default class App extends Component {
title
:
'
Hello
'
,
title
:
'
Hello
'
,
body
:
'
Test Notification
'
,
body
:
'
Test Notification
'
,
priority
:
"
high
"
,
priority
:
"
high
"
,
show_in_foreground
:
true
show_in_foreground
:
true
,
picture
:
'
https://firebase.google.com/_static/af7ae4b3fc/images/firebase/lockup.png
'
});
});
}
}
...
...
Examples/simple-fcm-client/app/PushController.js
View file @
24c29f39
...
@@ -48,34 +48,23 @@ export default class PushController extends Component {
...
@@ -48,34 +48,23 @@ export default class PushController extends Component {
notif
.
finish
(
WillPresentNotificationResult
.
All
)
//other types available: WillPresentNotificationResult.None
notif
.
finish
(
WillPresentNotificationResult
.
All
)
//other types available: WillPresentNotificationResult.None
break
;
break
;
}
}
}
}
this
.
showLocalNotification
(
notif
);
});
this
.
refreshTokenListener
=
FCM
.
on
(
FCMEvent
.
RefreshToken
,
token
=>
{
console
.
log
(
"
TOKEN (refreshUnsubscribe)
"
,
token
);
this
.
props
.
onChangeToken
(
token
);
});
// direct channel related methods are ios only
this
.
refreshTokenListener
=
FCM
.
on
(
FCMEvent
.
RefreshToken
,
token
=>
{
// directly channel is truned off in iOS by default, this method enables it
console
.
log
(
"
TOKEN (refreshUnsubscribe)
"
,
token
);
FCM
.
enableDirectChannel
();
this
.
props
.
onChangeToken
(
token
);
this
.
channelConnectionListener
=
FCM
.
on
(
FCMEvent
.
DirectChannelConnectionChanged
,
(
data
)
=>
{
});
console
.
log
(
'
direct channel connected
'
+
data
);
});
setTimeout
(
function
()
{
FCM
.
isDirectChannelEstablished
().
then
(
d
=>
console
.
log
(
d
));
},
1000
);
}
showLocalNotification
(
notif
)
{
// direct channel related methods are ios only
FCM
.
presentLocalNotification
({
// directly channel is truned off in iOS by default, this method enables it
title
:
notif
.
title
,
FCM
.
enableDirectChannel
();
body
:
notif
.
body
,
this
.
channelConnectionListener
=
FCM
.
on
(
FCMEvent
.
DirectChannelConnectionChanged
,
(
data
)
=>
{
priority
:
"
high
"
,
console
.
log
(
'
direct channel connected
'
+
data
);
click_action
:
notif
.
click_action
,
});
show_in_foreground
:
true
setTimeout
(
function
()
{
});
FCM
.
isDirectChannelEstablished
().
then
(
d
=>
console
.
log
(
d
));
},
1000
);
})
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
...
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