react-native-webrtc / react-native-webrtc/react-native-callkeep

backToForeground() Android 11 (Xiaomi K20 pro) do nothing

Open
#477 2 comments 5 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.