Skip to content

Commit

Permalink
refactor(ios): refactor error check
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Bonny committed Oct 5, 2021
1 parent e216ead commit 49c970a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.1

- Refactored ios local authentication check

## 1.2.0

- Fixed bug with ios no lockscreen case
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.0"
version: "1.2.1"
sky_engine:
dependency: transitive
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/ScreenLockCheckPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
LAContext *context = [LAContext new];
NSError *error;
BOOL isLockScreenEnabled = [context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&error];
if (error != nil && !([error.domain isEqualToString:@"com.apple.LocalAuthentication"] && error.code == -5)) {
if (error != nil && error.code != LAErrorPasscodeNotSet) {
result([FlutterError errorWithCode:@"UNAVAILABLE"
message:@"Local authentication context is unavailable"
details:error.localizedDescription]);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: screen_lock_check
description: A plugin that checks whether the user has enabled a passcode, pattern lock, face id or touch id on their device.
version: 1.2.0
version: 1.2.1
homepage: https://github.com/koa-health/screen_lock_check

environment:
Expand Down

0 comments on commit 49c970a

Please sign in to comment.