Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sieuhuflit/react-native-unlock-device
React native unlock screen and wakeup device for Android
https://github.com/sieuhuflit/react-native-unlock-device
react react-native unlock unlock-screen wakeup
Last synced: 18 days ago
JSON representation
React native unlock screen and wakeup device for Android
- Host: GitHub
- URL: https://github.com/sieuhuflit/react-native-unlock-device
- Owner: sieuhuflit
- Created: 2019-02-01T04:57:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-13T16:46:20.000Z (over 4 years ago)
- Last Synced: 2024-08-09T15:20:44.420Z (5 months ago)
- Topics: react, react-native, unlock, unlock-screen, wakeup
- Language: Java
- Size: 14.6 KB
- Stars: 13
- Watchers: 0
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-unlock-device
## Getting started
`$ npm install react-native-react-native-unlock-device --save`
### Mostly automatic installation
`$ react-native link react-native-react-native-unlock-device`
### Manual installation
#### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import com.reactlibrary.RNUnlockDevicePackage;` to the imports at the top of the file
- Add `new RNUnlockDevicePackage()` to the list returned by the `getPackages()` method2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-react-native-unlock-device'
project(':react-native-react-native-unlock-device').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-react-native-unlock-device/android')
```3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-react-native-unlock-device')
```Add this this `AndroidManifest.xml`
```xml
```
## Usage
```javascript
import RNUnlockDevice from 'react-native-unlock-device';// TODO: What to do with the module?
RNUnlockDevice.unlock()
.then(() => console.log('Success'))
.catch(error => console.log('Error', error));
```