Skip to content

Commit d30ea17

Browse files
committed
Merge branch 'release/0.1.1'
2 parents 2401e80 + 1560d9c commit d30ea17

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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 => {

ios/RCTTwilio/RCTTwilio.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-twilio",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "A React Native wrapper for the Twilio mobile SDK",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)