Weird: RNCallkit is not defined
pewh opened this issue · comments
Hello, I got an error RNCallkit while trying to import from JS file.
I already link this library manually by:
- Drag RNCallKit.xcodeproj into Libraries
- Add
$(SRCROOT)/../node_modules/react-native-callkit/ios/RNCallKit(recursive) in project's Header Search Path - Add libRNCallkit.a, CallKit.framework, Intent.framework into project's Build Phases
- Modify AppDelegate.m to
#import "RNCallKit.h"and Handling User Activity - Trying to clean & re-build several times, restart Mac, but still doesn't work
I'm using RN 0.52.1, installing on my real device iPhone 5s, use RNCallkit 1.3.1.
I've following those solutions before, but no luck. When I try to console.log(RNCallKit), it also thrown an error, that seems not registered to JS.
Okay, can you please share some error messages?
[tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: ReferenceError: RNCallkit is not defined
This error is located at:
in Root (at renderApplication.js:35)
in RCTView (at View.js:71)
in View (at AppContainer.js:102)
in RCTView (at View.js:71)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:34)
my root.js
...
import RNCallKit from 'react-native-callkit'
...
export default class Root extends Component {
...
componentDidMount() {
const r = RNCallkit // thrown error here
debugger
RNCallkit.setup({ appName: 'asd' })
RNCallkit.displayIncomingCall('foo', 'bar', 'generic', true)
}
render(){return null }
}
trying run RNCallkit via onpress touchableopacity but same error
Not sure if it is a typo but the K is uppercase in import statement but lowercase when using it.
Wow... You save my life! I don't realize that this typo make me feel dumb. Anyway, thanks! 🍻