react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
897 stars 437 forks source link

Android 12 native call UI #585

Open saribalorhan opened 2 years ago

saribalorhan commented 2 years ago

Bug report

Description

Android native call screen does not come when the app is killed status but the headless task is activated and the app wakes up in the background. I can see the console logs in debug mode, but the application does not come to the foreground. Native call screen does not appear.

If the application is in the background or foreground status, there is no problem. This problem I mentioned only happens on android 12 devices and when the application is closed. Previous android versions also working fine.

also checked

if (!RNCallKeep.supportConnectionService()) {
    console.warn("ConnectionService not supported!");
}

if (!RNCallKeep.hasPhoneAccount()) {
    console.warn("No phone account!");
}

above methods are not entering if blocks. So, I assume these conditions are ok.

Steps to Reproduce

standard install instructions

Versions

- Callkeep: 4.3.3
- React Native: 0.63.2
- iOS: -
- Android: 12
- Phone model:  Samsung Galaxy S20+

Logs

Paste here
glesperance commented 2 years ago

~I am having the same issue on Samsung Galaxy A32 5G~ see below

glesperance commented 2 years ago

Update: turns out my problem was related to some other interactions with my app.

saribalorhan commented 2 years ago

576 -> if I do related request steps, working fine too. But I don't want to edit node modules actually.

@glesperance can you share what did you do to fix this issue?

glesperance commented 2 years ago

@saribalorhan My issue was related to some initialization problems with Firebase Cloud Messaging. On Android I use FCM to notify the user of an incoming call and -- although I did not get to the root cause -- RNFirebase seems that it could get initialized in such a way that would cause inconsistencies / race conditions.

To fix this I put all might imports for that library in one file that would then get imported throughout the app, that way I could make sure the library is always properly initialized before getting used.

I did the same for RNCallkeep as well.

Hope that helps!

saribalorhan commented 2 years ago

Thank you @glesperance I'll try as soon as possible