You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I am facing an issue while integrating CallKeep in my React Native app. It works as expected in the foreground and background, but in the killed state, answering the call does not trigger the listener, preventing any action.
import React, { useEffect } from "react";
import { AppRegistry, NativeModules, Platform, NativeEventEmitter } from "react-native";
import App from "./App";
import { name as appName } from "./app.json";
import VoipPushNotification from "react-native-voip-push-notification";
import RNCallKeep from "react-native-callkeep";
import messaging from "@react-native-firebase/messaging";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { extractGuid } from "./app/utilities/extractGuid";
import BackgroundTimer from "react-native-background-timer";
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import { each, compact, last, get } from "lodash";
const callKeepEmitter = new NativeEventEmitter(RNCallKeep);
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
if (remoteMessage) {
const notificationPayload = remoteMessage?.data;
const guid = extractGuid(notificationPayload);
if (guid) {
if (Platform.OS === "android") {
NativeModules.ButterFlyMX.processCall(guid, (error, result) => {});
}
} else {
console.log("GUID not found in notification payload");
}
} else {
console.log("No notification found in FCM message");
}
});
const options = {
ios: {
appName: "callApp",
supportsVideo: true,
maximumCallGroups: "1",
maximumCallsPerCallGroup: "1",
},
android: {
alertTitle: "Permissions required",
alertDescription: "This application needs to access your phone accounts",
cancelButton: "Cancel",
okButton: "OK",
},
};
const AppWithCallKeep = ({ isHeadless }) => {
const onDidLoadWithNativeEvents = (events) => {
const validEvents = compact(events);
let callDataToAdd = null;
let callDataToAnswer = null;
let callDataToReject = null;
let callDataToInitiateCall = null;
each(compact(validEvents), (event) => {
const { name, data } = event;
if (name === "RNCallKeepDidDisplayIncomingCall") {
callDataToAdd = data;
recieveCall(data);
callDataToAnswer = null;
callDataToReject = null;
}
if (name === "RNCallKeepPerformAnswerCallAction") {
callDataToReject = null;
callDataToAnswer = data;
answerCall(data);
}
if (name === "RNCallKeepPerformEndCallAction") {
callDataToAnswer = null;
callDataToReject = data;
`
Steps to Reproduce
I have a scenario I am calling call UI from swift it works when I am in foreground,
but when ever I answer call from kill state it just open the app dont call UI as answeraction listener does not triggered
Bug report
Hi
I am facing an issue while integrating CallKeep in my React Native app. It works as expected in the foreground and background, but in the killed state, answering the call does not trigger the listener, preventing any action.
Reproduced on:
iOS
Description
This is AppDelegate.m
index.js
Steps to Reproduce
I have a scenario I am calling call UI from swift it works when I am in foreground,
but when ever I answer call from kill state it just open the app dont call UI as answeraction listener does not triggered
Versions
Logs
The text was updated successfully, but these errors were encountered: