MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
153 stars 66 forks source link

Unable to import #95

Open heyalexchoi opened 2 years ago

heyalexchoi commented 2 years ago

Simple import and invocation breaks my app. package is installed and so are pods.

import { RNTwilioPhone } from 'react-native-twilio-phone'
console.log('RNTwilioPhone: ', RNTwilioPhone)
 ERROR  Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
 ERROR  TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "./RNTwilioPhone").RNTwilioPhone')
heyalexchoi commented 2 years ago

ios project does not need firebase since that is only used for android. attempting to import firebase messaging in ios project breaks. issue. maybe this works if you actually install the pods and so on but there's a ton of subdependencies with special build configurations etc that I don't really want to deal with especially since that code will never even be called in an ios app.

this changes import of firebase messaging to conditional import since it is only conditionally used on android.

PR