Skip to content

Commit ced9b22

Browse files
Shreyas Patilfabriziomoscon
authored andcommitted
fix: iOS add handler to hold/unhold call
- fix index.js handler
1 parent 1587c37 commit ced9b22

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const Twilio = {
7272
setMuted: TwilioVoice.setMuted,
7373
setSpeakerPhone: TwilioVoice.setSpeakerPhone,
7474
sendDigits: TwilioVoice.sendDigits,
75-
hold: TwilioVoice.hold,
75+
hold: TwilioVoice.setOnHold,
7676
requestPermissions(senderId) {
7777
if (Platform.OS === ANDROID) {
7878
TwilioVoice.requestPermissions(senderId)

ios/RNTwilioVoice/RNTwilioVoice.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ - (void)dealloc {
131131
self.activeCall.muted = muted ? YES : NO;
132132
}
133133

134+
RCT_EXPORT_METHOD(setOnHold: (BOOL *)isOnHold) {
135+
NSLog(@"Hold/Unhold call");
136+
self.activeCall.onHold = isOnHold ? YES : NO;
137+
}
138+
134139
RCT_EXPORT_METHOD(setSpeakerPhone: (BOOL *)speaker) {
135140
[self toggleAudioRoute: speaker ? YES : NO];
136141
}

0 commit comments

Comments
 (0)