react-native-webrtc / react-native-webrtc/react-native-callkeep
backToForeground() Android 11 (Xiaomi K20 pro) do nothing
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 511
- Avg merge
- 9h 12m
- Merged PRs (30d)
- 2
Description
Bug report
-
I've checked the example to reproduce the issue.
-
Reproduced on:
-
[x ] Android
-
iOS
Description
When app is in background & killed. The app received message from Firebase and I run RNCallKeep setup then RNCallKeep set active true, and RN.backToForeground() but nothing happens
Steps to Reproduce
import messaging from '@react-native-firebase/messaging';
import {AppRegistry} from 'react-native';
import {isAndroid} from 'react-native-modalize/lib/utils/devices';
import {name as appName} from './app.json';
import App from './src/App';
import {handleRemoteMessage} from './src/screens/WithStringeeClient';
isAndroid &&
messaging().setBackgroundMessageHandler(async remoteMessage => {
handleRemoteMessage(remoteMessage);
});
AppRegistry.registerComponent(appName, () => App);
in App.js
function setupCallKeep() {
isAndroid &&
RNCallKeep.setup({
android: {
alertTitle: 'Permissions required',
alertDescription: 'This application needs to access your phone accounts',
cancelButton: 'Cancel',
okButton: 'ok',
imageName: 'ic_launcher',
selfManaged: false,
foregroundService: {
channelId: 'channelId',
channelName: 'channelName',
notificationTitle: 'notificationTitle',
},
},
});
RNCallKeep.setAvailable(true);
RNCallKeep.backToForeground();
}
export function handleRemoteMessage(remoteMessage) {
const data = JSON.parse(remoteMessage.data.data);
const callStatus = data.callStatus;
const from = data.from.number;
if (callStatus === 'started') {
try {
setupCallKeep();
} catch (e) {
console.log('initializeCallKeep error: ' + e.message);
}
} else if (callStatus === 'ended') {
RNCallKeep.endAllCalls();
}
}
Versions
- Callkeep: 4.2.0
- React Native: 0.64.2
- iOS:
- Android: 11
- Phone model: Xiaomi k20 pro
Logs
Paste here
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied setBackgroundMessageHandler and setupCallKeep reproduction, focusing on RNCallKeep.backToForeground() after the app is killed. Run it on Android 11 with the Xiaomi K20 Pro configuration and inspect the setup and foreground transition path. Done means the reported transition works or the limitation is documented with supporting logs and a regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100