Skip to content

shilwantkumar/expo-secureflag

Repository files navigation

expo-secureflag

This module used for enable/disable app preview feature

API documentation

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install expo-secureflag

Use ExpoSecureflag in your expo app (App.js)

import * as ExpoSecureflag from "expo-secureflag";
import React from "react";
import { Text, View, Button } from "react-native";

export default function App() {
  const [isEnabled, setIsEnabled] = React.useState(true);
  const disableFunc = () => {
    ExpoSecureflag.activate();
    setIsEnabled(false);
  };

  const enableFunc = () => {
    ExpoSecureflag.deactivate();
    setIsEnabled(true);
  };

  return (
    <View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
      <Text>App preview: {isEnabled?'Enabled':'Disabled'}</Text>
      {isEnabled ? (
        <View style={{ width: "200px", marginTop: 20 }}>
          <Button title="Disable App preview" onPress={disableFunc} />
        </View>
      ) : (
        <View style={{ width: "200px", marginTop: 20 }}>
          <Button title="Enable App preview" onPress={enableFunc} />
        </View>
      )}
    </View>
  );
}

Configure for iOS

Run npx pod-install after installing the npm package.

Configure for Android

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published