usepiipulrn
v0.0.2
Published
[](https://www.npmjs.com/package/usepiipulrn)
Readme
UsePiipulRN
Getting started
Installation
npm install usepiipulrn react-native-progress react-native-svg react-native-vision-camera --saveor with yarn
yarn add usepiipulrn react-native-progress react-native-svg react-native-vision-cameraExpo
Add the VisionCamera plugin to your Expo config (app.json, app.config.json or app.config.js):
{
"name": "my app",
"plugins": [
[
"react-native-vision-camera",
{
"cameraPermissionText": "$(PRODUCT_NAME) needs access to your Camera."
}
]
]
}React Native
IOS
Open your project's Info.plist and add the following lines inside the outermost <dict> tag:
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Camera.</string>Android
Open your project's AndroidManifest.xml and add the following lines inside the <manifest> tag:
<uses-permission android:name="android.permission.CAMERA" />Requirements
VisionCamera requires iOS 12 or higher, and Android-SDK version 26 or higher.
Usage example
// App.ts
import PiipulProvider from "usepiipulrn"
function App() {
return (
<PiipulProvider>
<SafeAreaView>{/* Rest of your screens and codes */}</SafeAreaView>
</PiipulProvider>
)
}
// AuthScreen.ts
import { piipulAuth } from "usepiipulrn"
export default function PaymentScreen() {
const open = () => {
piipulAuth.open()
}
return (
<View>
<Button title="Use piipul" onPress={open} />
</View>
)
}