Skip to content

intergalacticspacehighway/react-native-lockscreen-view

Repository files navigation

WIP

Control view that should be shown in app switcher when app goes to background. Only works on iOS for now.

Screen.Recording.2023-01-30.at.11.41.03.AM.mov

Installation

yarn add react-native-lockscreen-view
// or
npm i react-native-lockscreen-view

Usage

  • Checkout example/ directory
import { ReactNativeLockscreenView } from "react-native-lockscreen-view";

export default function App() {
  const [visible, setVisible] = useState(true);

  return (
    <View style={styles.container}>
      <Text>hello world</Text>
      <ReactNativeLockscreenView onReset={() => setVisible(true)}>
        {visible ? <Passcode hide={() => setVisible(false)} /> : null}
      </ReactNativeLockscreenView>
    </View>
  );
}

const Passcode = (props) => {
  const { hide } = props;
  return (
    <Modal visible>
      <View style={styles.container}>
        <Button title="Tap to unlock" onPress={hide} />
      </View>
    </Modal>
  );
};

Expo support

  • ✅ You can use this library with Development Builds. No config plugin is required.

    • After installing the library, run expo prebuild command to rebuild the native app.
  • ❌ This library can't be used in the "Expo Go" app because it requires custom native code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published