-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[local_auth_darwin] macOS Support #6267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
532ed7f
0eb64ee
25ca34e
c57ac02
00bd678
509708f
fd6c539
44dd8c8
4f68b52
8646867
676b0eb
bcee2e7
4aab9d8
1bded66
7335837
849c07b
c810eb4
6867b3a
995f41d
8ab5d09
507470e
05b52ae
8f35101
2b0e6d6
c808c82
64bd0b7
7dab5b4
7ff9871
04f6a76
04c8f12
64366dd
7babc9c
b71f172
cfabac0
5bc080e
d794eb9
74ae648
2374375
f053fce
04049a3
9be16c3
ff533bc
783b0cc
5e9b627
1748039
ebdb5f1
b73254a
c4c9f3b
6ca1476
69db0ec
a39e82a
59ce98a
e54c7ea
b8ca53a
018fe8f
ff38a26
e76f6bc
72b8212
113195e
7525f01
6330a9e
79ebae9
0c84f2b
c84a376
5dc7c75
c33ed13
186d89c
f9e11db
c45084b
7003142
18453dc
fc14107
5840a73
ce1fa37
ad83e24
8beb6dd
067a0c0
e3e89d4
a9167cc
0f56ad6
17bd1c7
2441440
8af7ec7
4fcbc5d
8bd0531
44e5ae3
51b3b02
6d0684f
ca5789f
6d5a0c6
11e6991
316bb68
3728490
5b72aea
6dd9092
b5ea028
dd545e5
85678af
679854a
464ae48
05bc529
d3ce499
57c50d3
860d198
9224412
9c345f9
71a2824
0d420c5
3415984
09236d6
b0de86c
288b04b
23305d0
2293ff6
46ce252
0f7dac8
a91e4e9
e5c9b97
f90387f
9024825
91a6d10
2b2ebab
8c9d1d1
ee97d66
211bc52
fabc0d4
568c0ea
371124c
3b7b5b9
a6a0019
25b6411
5e9af66
a8a4317
c3e81e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,16 @@ | ||
| ## 2.0.0 | ||
|
|
||
| - Adds MacOS Support. Requires MacOS 10.15 or higher | ||
alexrabin-sentracam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
alexrabin-sentracam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 1.2.2 | ||
|
|
||
| * Adds compatibility with `intl` 0.19.0. | ||
| - Adds compatibility with `intl` 0.19.0. | ||
alexrabin-sentracam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 1.2.1 | ||
|
|
||
| * Renames the Objective-C plugin classes to avoid runtime conflicts with | ||
| - Renames the Objective-C plugin classes to avoid runtime conflicts with | ||
| `local_auth_ios` in apps that have transitive dependencies on both. | ||
|
|
||
| ## 1.2.0 | ||
|
|
||
| * Renames the package previously published as [`local_auth_ios`](https://pub.dev/packages/local_auth_ios) | ||
| - Renames the package previously published as [`local_auth_ios`](https://pub.dev/packages/local_auth_ios) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,26 @@ - (void)showAlertWithMessage:(NSString *)message | |
| dismissButtonTitle:(NSString *)dismissButtonTitle | ||
| openSettingsButtonTitle:(NSString *)openSettingsButtonTitle | ||
| completion:(FLADAuthCompletion)completion { | ||
| #if TARGET_OS_OSX | ||
| NSAlert *alert = [[NSAlert alloc] init]; | ||
| [alert setMessageText:message]; | ||
| [alert addButtonWithTitle:dismissButtonTitle]; | ||
| if (openSettingsButtonTitle != nil) { | ||
| [alert addButtonWithTitle:openSettingsButtonTitle]; | ||
| } | ||
| [alert beginSheetModalForWindow:NSApp.keyWindow | ||
alexrabin-sentracam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| completionHandler:^(NSModalResponse returnCode) { | ||
| if (returnCode == NSAlertSecondButtonReturn) { | ||
| NSURL *url = [NSURL URLWithString:@"x-apple.systempreferences:com.apple." | ||
|
||
| @"preference.security?Privacy_Biometry"]; | ||
| [[NSWorkspace sharedWorkspace] openURL:url]; | ||
| } | ||
| [self handleSucceeded:NO withCompletion:completion]; | ||
| }]; | ||
| return; | ||
| #endif | ||
|
|
||
| #if TARGET_OS_IOS | ||
alexrabin-sentracam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| UIAlertController *alert = | ||
| [UIAlertController alertControllerWithTitle:@"" | ||
| message:message | ||
|
|
@@ -182,6 +202,8 @@ - (void)showAlertWithMessage:(NSString *)message | |
| [[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:alert | ||
| animated:YES | ||
| completion:nil]; | ||
|
|
||
| #endif | ||
| } | ||
|
|
||
| - (void)handleAuthReplyWithSuccess:(BOOL)success | ||
|
|
@@ -257,12 +279,14 @@ - (void)handleError:(NSError *)authError | |
|
|
||
| #pragma mark - AppDelegate | ||
|
|
||
| #if TARGET_OS_IOS | ||
alexrabin-sentracam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - (void)applicationDidBecomeActive:(UIApplication *)application { | ||
| if (self.lastCallState != nil) { | ||
| [self authenticateWithOptions:_lastCallState.options | ||
| strings:_lastCallState.strings | ||
| completion:_lastCallState.resultHandler]; | ||
| } | ||
| } | ||
| #endif | ||
|
|
||
| @end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Miscellaneous | ||
| *.class | ||
| *.log | ||
| *.pyc | ||
| *.swp | ||
| .DS_Store | ||
| .atom/ | ||
| .buildlog/ | ||
| .history | ||
| .svn/ | ||
| migrate_working_dir/ | ||
|
|
||
| # IntelliJ related | ||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
| .idea/ | ||
|
|
||
| # The .vscode folder contains launch configuration and tasks you configure in | ||
| # VS Code which you may wish to be included in version control, so this line | ||
| # is commented out by default. | ||
| #.vscode/ | ||
|
|
||
| # Flutter/Dart/Pub related | ||
| **/doc/api/ | ||
| **/ios/Flutter/.last_build_id | ||
| .dart_tool/ | ||
| .flutter-plugins | ||
| .flutter-plugins-dependencies | ||
| .pub-cache/ | ||
| .pub/ | ||
| /build/ | ||
|
|
||
| # Symbolication related | ||
| app.*.symbols | ||
|
|
||
| # Obfuscation related | ||
| app.*.map.json | ||
|
|
||
| # Android Studio will place build artifacts here | ||
| /android/app/debug | ||
| /android/app/profile | ||
| /android/app/release |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # This file tracks properties of this Flutter project. | ||
| # Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
| # | ||
| # This file should be version controlled and should not be manually edited. | ||
|
|
||
| version: | ||
| revision: "41456452f29d64e8deb623a3c927524bcf9f111b" | ||
| channel: "stable" | ||
|
|
||
| project_type: app | ||
|
|
||
| # Tracks metadata for the flutter migrate command | ||
| migration: | ||
| platforms: | ||
| - platform: root | ||
| create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b | ||
| base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b | ||
| - platform: macos | ||
| create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b | ||
| base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b | ||
|
|
||
| # User provided section | ||
|
|
||
| # List of Local paths (relative to this file) that should be | ||
| # ignored by the migrate tool. | ||
| # | ||
| # Files that are not part of the templates will be ignored by default. | ||
| unmanaged_files: | ||
| - 'lib/main.dart' | ||
| - 'ios/Runner.xcodeproj/project.pbxproj' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Flutter-related | ||
| **/Flutter/ephemeral/ | ||
| **/Pods/ | ||
|
|
||
| # Xcode-related | ||
| **/dgph | ||
| **/xcuserdata/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
| #include "ephemeral/Flutter-Generated.xcconfig" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
| #include "ephemeral/Flutter-Generated.xcconfig" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| platform :osx, '10.15' | ||
|
|
||
| # CocoaPods analytics sends network stats synchronously affecting flutter build latency. | ||
| ENV['COCOAPODS_DISABLE_STATS'] = 'true' | ||
|
|
||
| project 'Runner', { | ||
| 'Debug' => :debug, | ||
| 'Profile' => :release, | ||
| 'Release' => :release, | ||
| } | ||
|
|
||
| def flutter_root | ||
| generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) | ||
| unless File.exist?(generated_xcode_build_settings_path) | ||
| raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" | ||
| end | ||
|
|
||
| File.foreach(generated_xcode_build_settings_path) do |line| | ||
| matches = line.match(/FLUTTER_ROOT\=(.*)/) | ||
| return matches[1].strip if matches | ||
| end | ||
| raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" | ||
| end | ||
|
|
||
| require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | ||
|
|
||
| flutter_macos_podfile_setup | ||
|
|
||
| target 'Runner' do | ||
| use_frameworks! | ||
| use_modular_headers! | ||
|
|
||
| flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) | ||
| target 'RunnerTests' do | ||
| inherit! :search_paths | ||
| end | ||
| end | ||
|
|
||
| post_install do |installer| | ||
| installer.pods_project.targets.each do |target| | ||
| flutter_additional_macos_build_settings(target) | ||
| end | ||
| end |
Uh oh!
There was an error while loading. Please reload this page.