Reputation: 11
I am trying to create a video calling app using react native for front-end and firebase with voximplant for back-end. I have been able to implement the video call in such a way that when there is an incoming call, the app will log the user in by itself while the user is logged out and navigate to the calling screen so the user can answer the call. But this happens only when the app is already opened. What I want to do is that, when the app is closed I want an incoming call to open the app and then navigate to the calling screen so the callee can answer the call. I have tried push notification as recomended by voximplant but there is something I am missing. Please I need help with this. Thanks in advance.
This is my code for index.js, when I call a phone it only log the message to the console, it does not wake app.
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import messaging from "@react-native-firebase/messaging";
messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background!', remoteMessage);
// voximplant.handlePushNotification(remoteMessage.data);
});
AppRegistry.registerComponent(appName, () => App);
Upvotes: 0
Views: 732
Reputation: 256
Voximplant push notifications are sent as data messages. It means that when a push notification is received, the application wakes up, but in the background. So, user notifications or application activity are not shown.
The recommended flow to process push notifications for calls on the Voximplant platform is the following:
The way to show the notification about an incoming call depends on the application design. However, you should consider the Android platform limitations to start android activities from the background. Please find more information here: https://developer.android.com/guide/components/activities/background-starts
The most common solutions to notify the user about an incoming call are:
Upvotes: 0