Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Ringning State with selfManaged on Android #812

Open
1 task
orestesparra opened this issue Oct 7, 2024 · 0 comments
Open
1 task

Handling Ringning State with selfManaged on Android #812

orestesparra opened this issue Oct 7, 2024 · 0 comments

Comments

@orestesparra
Copy link

Bug report

  • [ x] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [x ] Android

  • iOS

Description

I’m currently using selfManaged in Android. When the phone is receiving an incoming call and is in the RINGING state, my app also receives a call, but the library is unable to manage this scenario properly.

I propose two possible solutions:

Solution 1:

I noticed in the code that there is a function public void onCallStateChanged.

Can I add a new action "RNCallKeepHasRingingCall" and, in the switch case (TelephonyManager.CALL_STATE_RINGING) (TelephonyManager.CALL_STATE_RINGING), include the following line of code?:

RNCallKeepModule.this.sendEventToJS("RNCallKeepHasRingingCall", args);

This would allow me to send an event to JavaScript notifying when the phone is in the RINGING state.

Additionally, I will create another event for the TelephonyManager.CALL_STATE_IDLE case to notify when the phone returns to the IDLE state.

Solution 2:

Create a private boolean property, hasRinging, and update its value in the aforementioned cases in solution 1. Then, I can export the value of this property via a function to JS

Please let me know which approach you would prefer so I can proceed with creating a PR

Regards
Orestes

Steps to Reproduce

Versions

- Callkeep: 4.3.14
- React Native: 0.75.2
- iOS: 17
- Android: 34
- Phone model: 

Logs

Paste here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant