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

Handling Ringning State with selfManaged on Android

Open
#812 1 comment 0 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

  • [ 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

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 in the Android implementation around RNCallKeepModule.onCallStateChanged and the TelephonyManager.CALL_STATE_RINGING and CALL_STATE_IDLE cases. Clarify whether the project wants an event or an exported state before defining the behavior, then verify that JavaScript can distinguish an active system ringing call from the idle state.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.