From f5a2d526e5f9418b6f1e152616fc84ead7050501 Mon Sep 17 00:00:00 2001 From: Thiago Ribeiro Date: Fri, 8 Jul 2022 10:45:44 -0300 Subject: [PATCH 1/2] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e6d628..7df9b5b 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,25 @@ permit block screen ```sh npm install react-native-background-secure +or +yarn add react-native-background-secure ``` ## Usage ```js -import { multiply } from "react-native-background-secure"; +import { AppState } from 'react-native'; +import { blockScreen, unblockScreen } from "react-native-background-secure"; // ... -const result = await multiply(3, 7); +const subscriptionFocus = AppState.addEventListener('focus', () => { + unblockScreen(); +}); + +const subscriptionBlur = AppState.addEventListener('blur', () => { + blockScreen(); +}); ``` ## Contributing From 24a46a08e0b4958e7fbfaf79355e88476f98584f Mon Sep 17 00:00:00 2001 From: Thiago Ribeiro Date: Fri, 8 Jul 2022 10:48:18 -0300 Subject: [PATCH 2/2] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7df9b5b..2e7ec1e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # react-native-background-secure -permit block screen +Android Only + +Allow you hide the screen when your app goes to background mode. ## Installation ```sh