问题描述
我正在尝试使用
[tid:com.facebook.react.JavaScript]处理程序不是函数。 (在'handler(rtn)'中,'handler'未定义)
2016-09-27 11:00:57.857 [致命]
[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]未处理的JS异常:处理程序不是函数。 (在'handler(rtn)'中,'handler'未定义)。代码在index.js中的twilio app中打破
[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.
推荐答案
我已经解决了这个问题。问题不是在twilio npm。关于设置iOS反应原生项目的问题。
现在我已经使用了这个步骤
1-in node_modules,react-native-twilio / ios并将RCTTwilio.xcodeproj添加到
你的项目。
I have fixed that issue .issue is not in twilio npm . issue about the setup iOS react native project.now i have used this steps1-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
我错误地调用了Twilio.addEventListener(),
需要 Twilio.addEventListener('事件类型','调用事件hadler')
,
I have done mistake to call Twilio.addEventListener (),its need Twilio.addEventListener ('type of event', 'call a event hadler')
,
例如
Twilio.addEventListener('deviceDidReceiveIncoming', this._deviceDidReceiveIncoming);
这篇关于Twilio调用在iOS和Android中无法在react-native中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!