[local_auth] Fix retain self warning and pod lint warnings (#2685)
diff --git a/packages/local_auth/CHANGELOG.md b/packages/local_auth/CHANGELOG.md
index d0950a4..9a96428 100644
--- a/packages/local_auth/CHANGELOG.md
+++ b/packages/local_auth/CHANGELOG.md
@@ -2,6 +2,8 @@
* Remove Android dependencies fallback.
* Require Flutter SDK 1.12.13+hotfix.5 or greater.
+* Fix block implicitly retains 'self' warning.
+* Fix CocoaPods podspec lint warnings.
## 0.6.1+4
diff --git a/packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m b/packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m
index b9925e3..aa0c217 100644
--- a/packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m
+++ b/packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m
@@ -5,10 +5,13 @@
#import "FLTLocalAuthPlugin.h"
-@implementation FLTLocalAuthPlugin {
- NSDictionary *lastCallArgs;
- FlutterResult lastResult;
-}
+@interface FLTLocalAuthPlugin ()
+@property(copy, nullable) NSDictionary<NSString *, NSNumber *> *lastCallArgs;
+@property(nullable) FlutterResult lastResult;
+@end
+
+@implementation FLTLocalAuthPlugin
+
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
FlutterMethodChannel *channel =
[FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/local_auth"
@@ -91,8 +94,8 @@
withFlutterResult:(FlutterResult)result {
LAContext *context = [[LAContext alloc] init];
NSError *authError = nil;
- lastCallArgs = nil;
- lastResult = nil;
+ self.lastCallArgs = nil;
+ self.lastResult = nil;
context.localizedFallbackTitle = @"";
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
@@ -114,8 +117,8 @@
return;
case LAErrorSystemCancel:
if ([arguments[@"stickyAuth"] boolValue]) {
- lastCallArgs = arguments;
- lastResult = result;
+ self.lastCallArgs = arguments;
+ self.lastResult = result;
return;
}
}
@@ -158,8 +161,8 @@
#pragma mark - AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
- if (lastCallArgs != nil && lastResult != nil) {
- [self authenticateWithBiometrics:lastCallArgs withFlutterResult:lastResult];
+ if (self.lastCallArgs != nil && self.lastResult != nil) {
+ [self authenticateWithBiometrics:_lastCallArgs withFlutterResult:self.lastResult];
}
}
diff --git a/packages/local_auth/ios/local_auth.podspec b/packages/local_auth/ios/local_auth.podspec
index b84b7d2..b411ddd 100644
--- a/packages/local_auth/ios/local_auth.podspec
+++ b/packages/local_auth/ios/local_auth.podspec
@@ -4,14 +4,16 @@
Pod::Spec.new do |s|
s.name = 'local_auth'
s.version = '0.0.1'
- s.summary = 'A new flutter plugin project.'
+ s.summary = 'Flutter Local Auth'
s.description = <<-DESC
-A new flutter plugin project.
+This Flutter plugin provides means to perform local, on-device authentication of the user.
+Downloaded by pub (not CocoaPods).
DESC
- s.homepage = 'http://example.com'
- s.license = { :file => '../LICENSE' }
- s.author = { 'Your Company' => 'email@example.com' }
- s.source = { :path => '.' }
+ s.homepage = 'https://github.com/flutter/plugins'
+ s.license = { :type => 'BSD', :file => '../LICENSE' }
+ s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
+ s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/local_auth' }
+ s.documentation_url = 'https://pub.dev/packages/local_auth'
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'