Twilio call is not working in iOS and Android in react-native

我的梦境 提交于 2019-12-30 04:30:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!