File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ let Twilio = {
3232 ignore ( ) {
3333 TwilioRCT . ignore ( ) ;
3434 } ,
35+ setMuted ( isMuted ) {
36+ TwilioRCT . setMuted ( isMuted ) ;
37+ } ,
3538 addEventListener ( type , handler ) {
3639 _eventHandlers [ type ] . set ( handler , NativeAppEventEmitter . addListener (
3740 type , rtn => {
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ @implementation RCTTwilio {
5252 [_pendingConnection ignore ];
5353}
5454
55+ RCT_EXPORT_METHOD (setMuted:(BOOL )isMuted) {
56+ if (_connection && _connection.state == TCConnectionStateConnected) {
57+ [_connection setMuted: isMuted];
58+ }
59+ }
60+
5561#pragma mark - TCDeviceDelegate
5662
5763-(void )device : (TCDevice *)device didReceiveIncomingConnection : (TCConnection *)connection {
@@ -65,8 +71,12 @@ -(void)deviceDidStartListeningForIncomingConnections:(TCDevice*)device {
6571}
6672
6773-(void )device : (TCDevice *)device didStopListeningForIncomingConnections : (NSError *)error {
74+ id body = nil ;
75+ if (error != nil ) {
76+ body = @{@" err" : [error localizedDescription ]};
77+ }
6878 [self .bridge.eventDispatcher
69- sendAppEventWithName: @" deviceDidStopListening" body: @{ @" err " : [error localizedDescription ]} ];
79+ sendAppEventWithName: @" deviceDidStopListening" body: body ];
7080}
7181
7282#pragma mark - TCConnectionDelegate
You can’t perform that action at this time.
0 commit comments