Implement Secure device lock authentication (biometrics) with offline App PIN support

This commit is contained in:
mansi-dev
2026-01-17 23:54:33 +05:30
parent e4f91128ed
commit 6b328f1733
4 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import React, { useState } from 'react';
import { View, TextInput, Text, TouchableOpacity } from 'react-native';
import { savePin } from '../auth/AppPinService';
const SetPinScreen = ({ onDone }: any) => {
const [pin, setPin] = useState('');
const save = async () => {
await savePin(pin);
onDone();
};
return (
<View style={{ flex: 1, justifyContent: 'center', padding: 20 }}>
<Text>Create App PIN</Text>
<TextInput
secureTextEntry
keyboardType="number-pad"
maxLength={4}
value={pin}
onChangeText={setPin}
style={{ borderWidth: 1, padding: 12, marginVertical: 10 }}
/>
<TouchableOpacity onPress={save}>
<Text style={{ color: 'blue' }}>Save PIN</Text>
</TouchableOpacity>
</View>
);
};
export default SetPinScreen;