File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ let Twilio = {
32
32
ignore ( ) {
33
33
TwilioRCT . ignore ( ) ;
34
34
} ,
35
+ setMuted ( isMuted ) {
36
+ TwilioRCT . setMuted ( isMuted ) ;
37
+ } ,
35
38
addEventListener ( type , handler ) {
36
39
_eventHandlers [ type ] . set ( handler , NativeAppEventEmitter . addListener (
37
40
type , rtn => {
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ @implementation RCTTwilio {
52
52
[_pendingConnection ignore ];
53
53
}
54
54
55
+ RCT_EXPORT_METHOD (setMuted:(BOOL )isMuted) {
56
+ if (_connection && _connection.state == TCConnectionStateConnected) {
57
+ [_connection setMuted: isMuted];
58
+ }
59
+ }
60
+
55
61
#pragma mark - TCDeviceDelegate
56
62
57
63
-(void )device : (TCDevice *)device didReceiveIncomingConnection : (TCConnection *)connection {
@@ -65,8 +71,12 @@ -(void)deviceDidStartListeningForIncomingConnections:(TCDevice*)device {
65
71
}
66
72
67
73
-(void )device : (TCDevice *)device didStopListeningForIncomingConnections : (NSError *)error {
74
+ id body = nil ;
75
+ if (error != nil ) {
76
+ body = @{@" err" : [error localizedDescription ]};
77
+ }
68
78
[self .bridge.eventDispatcher
69
- sendAppEventWithName: @" deviceDidStopListening" body: @{ @" err " : [error localizedDescription ]} ];
79
+ sendAppEventWithName: @" deviceDidStopListening" body: body ];
70
80
}
71
81
72
82
#pragma mark - TCConnectionDelegate
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-twilio" ,
3
- "version" : " 0.1.0 " ,
3
+ "version" : " 0.1.1 " ,
4
4
"description" : " A React Native wrapper for the Twilio mobile SDK" ,
5
5
"repository" : {
6
6
"type" : " git" ,
You can’t perform that action at this time.
0 commit comments