Gustash / react-native-smart-lock

React Native implementation of Android Smart Lock
MIT License
10 stars 6 forks source link

Can't use this package with Expo #1

Closed EduardoRoc97 closed 4 years ago

EduardoRoc97 commented 4 years ago

Hello, I'm here with a problem: I'm trying to implement the SmartLock in my React Native app for Android and it gives me always error when I try to use the methods of the object to perform the actions of SmartLock in Android, because of the object "SmartLock" is null. image

I wanted you to take a look at your index.js file to see where it is going wrong.

Gustash commented 4 years ago

How are you importing it? Also, can you share the specific error you get?

EduardoRoc97 commented 4 years ago

I'm developing my app in Expo and I followed the steps described in the README section, but I'm getting the following error: image I'm importing the code in the following way. image and I'm using it in the following way: image I've been exploring your index.js file and, makin console.log in SmartLock, is giving me null on that object: image Could you explain me why it's giving me this error?

Gustash commented 4 years ago

You can't use this package with Expo because you can't use native packages that are not packaged in by Expo. You might be able to use this if you eject to an ExpoKit project, but I personally haven't tried that.

You're getting null because there is no SmartLock in your NativeModules, precisely for that reason.