Commit add9aade authored by Libin Lu's avatar Libin Lu

add remote notif nav example

parent 983aa001
...@@ -39,6 +39,11 @@ class MainPage extends Component { ...@@ -39,6 +39,11 @@ class MainPage extends Component {
this.setState({ this.setState({
initNotif: notif initNotif: notif
}) })
if(notif.targetScreen === 'detail'){
setTimeout(()=>{
this.props.navigation.navigate('Detail')
}, 500)
}
}); });
try{ try{
...@@ -102,10 +107,11 @@ class MainPage extends Component { ...@@ -102,10 +107,11 @@ class MainPage extends Component {
"data":{ "data":{
"custom_notification": { "custom_notification": {
"title": "Simple FCM Client", "title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.", "body": "Click me to go to detail",
"sound": "default", "sound": "default",
"priority": "high", "priority": "high",
"show_in_foreground": true "show_in_foreground": true,
targetScreen: 'detail'
} }
}, },
"priority": 10 "priority": 10
...@@ -115,8 +121,11 @@ class MainPage extends Component { ...@@ -115,8 +121,11 @@ class MainPage extends Component {
"to": token, "to": token,
"notification":{ "notification":{
"title": "Simple FCM Client", "title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.", "body": "Click me to go to detail",
"sound": "default" "sound": "default"
},
data: {
targetScreen: 'detail'
}, },
"priority": 10 "priority": 10
} }
......
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