react-native-webrtc / react-native-callkit

#deprecated iOS 10 new CallKit framework for React Native

Repository from Github https://github.comreact-native-webrtc/react-native-callkitRepository from Github https://github.comreact-native-webrtc/react-native-callkit

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:

  1. Drag RNCallKit.xcodeproj into Libraries
  2. Add $(SRCROOT)/../node_modules/react-native-callkit/ios/RNCallKit (recursive) in project's Header Search Path
  3. Add libRNCallkit.a, CallKit.framework, Intent.framework into project's Build Phases
  4. Modify AppDelegate.m to #import "RNCallKit.h" and Handling User Activity
  5. 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.

Hello, can you try solutions in #25 and #20?

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! 🍻