Skip to content

Commit 2a46103

Browse files
committed
Export sendDigits method
1 parent fde6095 commit 2a46103

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ let Twilio = {
3838
setMuted(isMuted) {
3939
TwilioRCT.setMuted(isMuted);
4040
},
41+
sendDigits(digits) {
42+
TwilioRCT.sendDigits(digits);
43+
},
4144
addEventListener(type, handler) {
4245
_eventHandlers[type].set(handler, NativeAppEventEmitter.addListener(
4346
type, rtn => {

ios/RCTTwilio/RCTTwilio.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ @implementation RCTTwilio {
6262
}
6363
}
6464

65+
RCT_EXPORT_METHOD(sendDigits:(NSString *) digits) {
66+
if (_connection && _connection.state == TCConnectionStateConnected) {
67+
[_connection sendDigits:digits];
68+
}
69+
}
70+
6571
#pragma mark - TCDeviceDelegate
6672

6773
-(void)device:(TCDevice *)device didReceiveIncomingConnection:(TCConnection *)connection {
@@ -104,7 +110,7 @@ -(void)connectionDidDisconnect:(TCConnection *)connection {
104110
if (connection == _connection) {
105111
_connection = nil;
106112
}
107-
113+
108114
if (connection == _pendingConnection) {
109115
_pendingConnection = nil;
110116
}

0 commit comments

Comments
 (0)