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
51ea457d
Commit
51ea457d
authored
Feb 12, 2018
by
Libin Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dismiss button
parent
28381c89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Examples/simple-fcm-client/app/App.js
Examples/simple-fcm-client/app/App.js
+1
-1
Examples/simple-fcm-client/app/Listeners.js
Examples/simple-fcm-client/app/Listeners.js
+9
-0
No files found.
Examples/simple-fcm-client/app/App.js
View file @
51ea457d
...
@@ -183,7 +183,7 @@ export default class App extends Component {
...
@@ -183,7 +183,7 @@ export default class App extends Component {
</TouchableOpacity>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.showLocalNotificationWithAction(token)} style={styles.button}>
<TouchableOpacity onPress={() => this.showLocalNotificationWithAction(token)} style={styles.button}>
<Text style={styles.buttonText}>Show Local Notification with Action</Text>
<Text style={styles.buttonText}>Show Local Notification with Action
(iOS)
</Text>
</TouchableOpacity>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.scheduleLocalNotification()} style={styles.button}>
<TouchableOpacity onPress={() => this.scheduleLocalNotification()} style={styles.button}>
...
...
Examples/simple-fcm-client/app/Listeners.js
View file @
51ea457d
...
@@ -26,6 +26,9 @@ export function registerAppListener(){
...
@@ -26,6 +26,9 @@ export function registerAppListener(){
if
(
notif
.
_actionIdentifier
===
'
com.myidentifi.fcm.text.reply
'
){
if
(
notif
.
_actionIdentifier
===
'
com.myidentifi.fcm.text.reply
'
){
alert
(
"
User replied:
"
+
notif
.
_userText
);
alert
(
"
User replied:
"
+
notif
.
_userText
);
}
}
if
(
notif
.
_actionIdentifier
===
'
com.myidentifi.fcm.text.dismiss
'
){
alert
(
"
User clicked Dismiss
"
);
}
}
}
if
(
Platform
.
OS
===
'
ios
'
){
if
(
Platform
.
OS
===
'
ios
'
){
...
@@ -74,6 +77,12 @@ FCM.setNotificationCategories([
...
@@ -74,6 +77,12 @@ FCM.setNotificationCategories([
textInputPlaceholder
:
'
Say something
'
,
textInputPlaceholder
:
'
Say something
'
,
intentIdentifiers
:
[],
intentIdentifiers
:
[],
options
:
NotificationActionOption
.
AuthenticationRequired
options
:
NotificationActionOption
.
AuthenticationRequired
},
{
type
:
NotificationActionType
.
Default
,
id
:
'
com.myidentifi.fcm.text.dismiss
'
,
title
:
'
Dismiss
'
,
intentIdentifiers
:
[]
}
}
],
],
options
:
[
NotificationCategoryOption
.
CustomDismissAction
,
NotificationCategoryOption
.
PreviewsShowTitle
]
options
:
[
NotificationCategoryOption
.
CustomDismissAction
,
NotificationCategoryOption
.
PreviewsShowTitle
]
...
...
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