how to open a app when its in quit state while receiving fcm push notification - REACT NATIVE

Viewed 858

Planning to build an app like uber we have two apps one for end users other for drivers, if end users send a booking notification we need to display in driver app push notification as 'cancel' and 'accept' button with sound like ringtone or we need to open the app automatically, if the app is in quit state or background state. Technologies used: - react native, firebase. Please help me to resolve and am eagerly waiting for your valuable suggestions and ideas

2 Answers

i would suggest you to go for https://rnfirebase.io/ using this you can have an node app or use firebase function to push notification to the device which is registered here you would use the following

onNotificationOpenedApp : When the user presses a notification displayed via FCM, this listener will be called if the app has opened from a background state.https://rnfirebase.io/reference/messaging

onNotificationOpenedApp(listener: (message: RemoteMessage) => any): () => void;
Related