react-native-twilio icon indicating copy to clipboard operation
react-native-twilio copied to clipboard

Connection has no connected handler

Open anotherstarburst opened this issue 8 years ago • 4 comments

Firstly - great effort porting this to RN!

I've got twilio client set up and working for desktop web-browsers. I'm using the same server methods and endpoints to make a call from my ios10 device (not the simulator). I've corrected the RN imports as per https://github.com/rogchap/react-native-twilio/pull/23 . I struggled at first because it seems that instead of

Twilio.initWithToken('sometoken');

one needs to use

Twilio.default.initWithToken('sometoken');

(the same for the other methods). However, no matter what I try I cannot manage to make an outbound call (microphone permissions have been enabled). As suggested I run the initWithToken on component mount and add the few listeners. Once I do I get the following errors

__nw_connection_get_connected_socket_block_invoke 1 Connection has no connected handler

but I understand from previous issues that we're to expect some errors filtering through. This does look suspect though...

I then go to

Twilio.default.connect({To: '+somenumber'})

But it fails with.

tsx0x1019e00a8  Temporary failure in sending Request msg INVITE/cseq=11711 (tdta0x1019fec00), will try next server: Operation timed out

I also tried the method I used in browser which has a params object for the server to facilitate the call but no dice.

Any clues on what may be going wrong?

anotherstarburst avatar Feb 02 '17 20:02 anotherstarburst

Hi @anotherstarburst , In fact i have encountered exactly with same problem. i am calling another client like this: Twilio.default.connect({To: 'client:kevin'}); How did you solve this issue ?. Thank you.

Moussawi7 avatar Apr 22 '17 09:04 Moussawi7

Hello, Same issue here, and this is the log:

'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' *** First throw call stack: ( 0 CoreFoundation 0x00000001057a434b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010434e21e objc_exception_throw + 48 2 CoreFoundation 0x00000001056bad8f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 351 3 CoreFoundation 0x00000001056babfb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59 4 kindi 0x00000001036ece87 -[TCConnectionInternal provideStats] + 1384 5 kindi 0x0000000103709b39 __21-[TCRTCMonitor start]_block_invoke + 70 6 libdispatch.dylib 0x00000001096a90cd _dispatch_client_callout + 8 7 libdispatch.dylib 0x00000001096851c3 _dispatch_continuation_pop + 1091 8 libdispatch.dylib 0x000000010969a1e2 _dispatch_source_latch_and_call + 195 9 libdispatch.dylib 0x0000000109692d7d _dispatch_source_invoke + 1098 10 libdispatch.dylib 0x0000000109689b2e _dispatch_main_queue_callback_4CF + 1006 11 CoreFoundation 0x00000001057684f9 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 12 CoreFoundation 0x000000010572df8d __CFRunLoopRun + 2205 13 CoreFoundation 0x000000010572d494 CFRunLoopRunSpecific + 420 14 GraphicsServices 0x000000010b091a6f GSEventRunModal + 161 15 UIKit 0x0000000107d20f34 UIApplicationMain + 159 16 kindi 0x0000000103573c1f main + 111 17 libdyld.dylib 0x00000001096f568d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

ArtsNCode avatar Apr 28 '17 08:04 ArtsNCode

That's a react-native devtools error

mobinni avatar Aug 04 '17 15:08 mobinni

@anotherstarburst The way you import this library probably is causing you to have to add .default to the import name. For example, instead of import {Twilio} from 'react-native-twilio' try import Twilio from 'react-native-twilio'

See https://stackoverflow.com/questions/31092142/why-cant-i-import-a-default-export-with-import-as-with-babeljs

peacechen avatar Sep 05 '17 21:09 peacechen