Commit 51ea457d authored by Libin Lu's avatar Libin Lu

add dismiss button

parent 28381c89
...@@ -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}>
......
...@@ -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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment