问题
i am trying to use twilio client in react native app. here is the link Twilio repo after done all setup with react native twilio .when i am calling a number getting issue . i used all steps give in this link .
[tid:com.facebook.react.JavaScript] handler is not a function. (In 'handler(rtn)', 'handler' is undefined) 2016-09-27 11:00:57.857 [fatal]
[tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: handler is not a function. (In 'handler(rtn)', 'handler' is undefined). code is breaking in twilio app in index.js
addEventListener(type, handler) {
_eventHandlers[type].set(handler, NativeAppEventEmitter.addListener(
type, rtn => {
handler(rtn);
}
));
},
not able to get where is the issue . i tried to implement in my native base code its working fine so my server setup does not have any issue .but don't how to solve in react native . any one have any idea about the issue.
回答1:
I have fixed that issue .issue is not in twilio npm . issue about the setup iOS react native project.
now i have used this steps
1-in node_modules,react-native-twilio/ios and add RCTTwilio.xcodeproj to
your project.
2- Add libRCTTwilio.a to Build Phases -> Link Binary With Libraries
I have done mistake to call Twilio.addEventListener (),
its need Twilio.addEventListener ('type of event', 'call a event hadler')
,
for example
Twilio.addEventListener('deviceDidReceiveIncoming', this._deviceDidReceiveIncoming);
来源:https://stackoverflow.com/questions/39716782/twilio-call-is-not-working-in-ios-and-android-in-react-native