Skip to content

Commit

Permalink
Start ringback method (#113)
Browse files Browse the repository at this point in the history
* add startRingback method

* fix things so things actually work

* fix the right variable name
  • Loading branch information
Dan Jenkins authored and zxcpoiu committed Jul 2, 2019
1 parent a481d4f commit b9da877
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ public void setMicrophoneMute(final boolean enable) {
* This is part of start() process.
* ringbackUriType must not empty. empty means do not play.
*/
@ReactMethod
public void startRingback(final String ringbackUriType) {
if (ringbackUriType.isEmpty()) {
return;
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ class InCallManager {
_InCallManager.stopRingtone();
}

startRingback(ringback) {
ringback = (typeof ringback === 'string') ? ringback : "_DTMF_";

_InCallManager.startRingback(ringback);
}

stopRingback() {
_InCallManager.stopRingback();
}
Expand Down
2 changes: 1 addition & 1 deletion ios/RNInCallManager/RNInCallManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ - (void)dealloc
NSLog(@"RNInCallManager.setMicrophoneMute(): ios doesn't support setMicrophoneMute()");
}

- (void)startRingback:(NSString *)_ringbackUriType
RCT_EXPORT_METHOD(startRingback:(NSString *)_ringbackUriType)
{
// you may rejected by apple when publish app if you use system sound instead of bundled sound.
NSLog(@"RNInCallManager.startRingback(): type=%@", _ringbackUriType);
Expand Down

0 comments on commit b9da877

Please sign in to comment.