react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

How to change the ringtone of an incoming call on the phone, depending on the parameters of the incoming call?

Open SumDanil opened this issue 1 year ago • 1 comments

  • Reproduced on:
  • [ X ] Android
  • [ ] iOS

Description

Can I change the ringtone of the phone during an incoming call, depending on the parameters of the incoming call (parameters that come in the push notification)? For example, for everyday incoming calls, I want to use one ringtone, and when I want to highlight an incoming call, so that the user understands that it is a special incoming call, I play another ringtone on the phone. If it is possible, please tell me how to do it, thanks in advance

SumDanil avatar Jun 04 '24 07:06 SumDanil

I'm not a maintainer of this repo, but just want to share one information for you. Personally I'm using react-native-incall-manager

// ringtone is basically for INCOMING call. it's independent to start() and stop()
// if you receiving an incoming call, before user pick up,
// you may want to play ringtone to notify user.
InCallManager.startRingtone('_BUNDLE_'); // or _DEFAULT_ or system filename with extension

// when user pickup
InCallManager.stopRingtone();
InCallManager.start();

// or user hangup
InCallManager.stopRingtone();
InCallManager.stop();

What about changing ringtone param in InCallManager.startRingtone(ringtone) according to some parameter in the push notification ?

taekeun-two avatar Jun 07 '24 05:06 taekeun-two