tschoffelen / react-native-email-link

📭 Open an email client from React Native (for 'magic link' type functionality).
MIT License
409 stars 74 forks source link

openInbox() is not working on Android #48

Closed TBenedyk closed 4 years ago

TBenedyk commented 4 years ago

I'm getting the following error when I run openInbox() on android. I have the gmail app on my phone. It's being run on expo. Can anybody help?

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNative.NativeModules.Email.open')]
- node_modules/react-native-email-link/index.android.js:39:22 in openInbox$
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:271:30 in invoke
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:28 in invoke
- node_modules/regenerator-runtime/runtime.js:170:17 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:169:27 in callInvokeWithMethodAndArg
- node_modules/regenerator-runtime/runtime.js:192:38 in enqueue
- node_modules/regenerator-runtime/runtime.js:216:8 in async
- node_modules/react-native-email-link/index.android.js:21:7 in openInbox
* screens/MagicLinkSelectedScreen.js:19:4 in onMailAppOpen
- node_modules/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android.js:213:45 in touchableHandlePress
- node_modules/react-native/Libraries/Components/Touchable/Touchable.js:878:34 in _performSideEffectsForTransition
- ... 21 more stack frames from framework internals
tschoffelen commented 4 years ago

On Android, this functionality requires a native module (since it has to create an Intent), meaning that it only works with regular React Native apps, not with Expo unfortunately...