ios faceid issue

merge-requests/322/head
Sultan Khan 5 years ago
parent 449540504c
commit 63d73b60e1

@ -25,7 +25,9 @@
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string> <string>Camera permission is required for barcode scanning.</string>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string> <string>We are using it for authentication</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart'
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart'; import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
@ -17,6 +18,7 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -233,7 +235,8 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => { onTap: () => {
authenticateUser(3, true, authProv) authenticateUser(3,
true, authProv)
}, },
child: getButton( child: getButton(
user.logInTypeID, user.logInTypeID,
@ -483,9 +486,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return InkWell( return InkWell(
onTap: () => { onTap: () => {
if (checkIfBiometricAvailable(BiometricType.fingerprint)) if (checkIfBiometricAvailable(BiometricType.fingerprint))
{ {authenticateUser(3, true, authProv)}
authenticateUser(3, true, authProv)
}
}, },
child: RoundedContainer( child: RoundedContainer(
backgroundColor: backgroundColor:
@ -703,10 +704,23 @@ class _VerificationMethodsState extends State<VerificationMethods> {
loginWithFingurePrintFace(type, isActive, authProv) async { loginWithFingurePrintFace(type, isActive, authProv) async {
if (isActive) { if (isActive) {
// this.startBiometricLoginIfAvailable(); // this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate', const iosStrings = const IOSAuthMessages(
useErrorDialogs: true, cancelButton: 'cancel',
stickyAuth: true); goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID');
try {
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e);
}
if (!mounted) return;
if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) { if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) {
this.sendActivationCode(type, authProv); this.sendActivationCode(type, authProv);
// this.checkActivationCode(authProv); // this.checkActivationCode(authProv);

Loading…
Cancel
Save