diff --git a/Examples/simple-fcm-client/app/App.js b/Examples/simple-fcm-client/app/App.js index 7e6f5b850a7ffc583d1704461c06087af9e01704..d8cb98aa17281275cca4ec767d4452aee25090d2 100644 --- a/Examples/simple-fcm-client/app/App.js +++ b/Examples/simple-fcm-client/app/App.js @@ -39,6 +39,11 @@ class MainPage extends Component { this.setState({ initNotif: notif }) + if(notif.targetScreen === 'detail'){ + setTimeout(()=>{ + this.props.navigation.navigate('Detail') + }, 500) + } }); try{ @@ -102,10 +107,11 @@ class MainPage extends Component { "data":{ "custom_notification": { "title": "Simple FCM Client", - "body": "This is a notification with only NOTIFICATION.", + "body": "Click me to go to detail", "sound": "default", "priority": "high", - "show_in_foreground": true + "show_in_foreground": true, + targetScreen: 'detail' } }, "priority": 10 @@ -115,9 +121,12 @@ class MainPage extends Component { "to": token, "notification":{ "title": "Simple FCM Client", - "body": "This is a notification with only NOTIFICATION.", + "body": "Click me to go to detail", "sound": "default" - }, + }, + data: { + targetScreen: 'detail' + }, "priority": 10 } }