@@ -84,7 +84,16 @@ - (void)alertMessage:(NSString *)message
8484 handler: ^(UIAlertAction *action) {
8585 if (UIApplicationOpenSettingsURLString != NULL ) {
8686 NSURL *url = [NSURL URLWithString: UIApplicationOpenSettingsURLString];
87- [[UIApplication sharedApplication ] openURL: url];
87+ if (@available (iOS 10 , *)) {
88+ [[UIApplication sharedApplication ] openURL: url
89+ options: @{}
90+ completionHandler: NULL ];
91+ } else {
92+ #pragma clang diagnostic push
93+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
94+ [[UIApplication sharedApplication ] openURL: url];
95+ #pragma clang diagnostic pop
96+ }
8897 result (@NO );
8998 }
9099 }];
@@ -113,9 +122,12 @@ - (void)deviceSupportsBiometrics:(FlutterResult)result {
113122 result (@YES );
114123 return ;
115124 }
125+ #pragma clang diagnostic push
126+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
116127 } else if (authError.code == LAErrorTouchIDNotEnrolled) {
117128 result (@YES );
118129 return ;
130+ #pragma clang diagnostic pop
119131 }
120132 }
121133
@@ -205,9 +217,14 @@ - (void)handleAuthReplyWithSuccess:(BOOL)success
205217 } else {
206218 switch (error.code ) {
207219 case LAErrorPasscodeNotSet:
220+ #pragma clang diagnostic push
221+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
222+ // TODO(stuartmorgan): Remove the pragma and s/TouchID/Biometry/ in these constants when
223+ // iOS 10 support is dropped. The values are the same, only the names have changed.
208224 case LAErrorTouchIDNotAvailable:
209225 case LAErrorTouchIDNotEnrolled:
210226 case LAErrorTouchIDLockout:
227+ #pragma clang diagnostic pop
211228 case LAErrorUserFallback:
212229 [self handleErrors: error flutterArguments: arguments withFlutterResult: result];
213230 return ;
@@ -228,7 +245,12 @@ - (void)handleErrors:(NSError *)authError
228245 NSString *errorCode = @" NotAvailable" ;
229246 switch (authError.code ) {
230247 case LAErrorPasscodeNotSet:
248+ #pragma clang diagnostic push
249+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
250+ // TODO(stuartmorgan): Remove the pragma and s/TouchID/Biometry/ in this constant when
251+ // iOS 10 support is dropped. The values are the same, only the names have changed.
231252 case LAErrorTouchIDNotEnrolled:
253+ #pragma clang diagnostic pop
232254 if ([arguments[@" useErrorDialogs" ] boolValue ]) {
233255 [self alertMessage: arguments[@" goToSettingDescriptionIOS" ]
234256 firstButton: arguments[@" okButton" ]
@@ -238,7 +260,12 @@ - (void)handleErrors:(NSError *)authError
238260 }
239261 errorCode = authError.code == LAErrorPasscodeNotSet ? @" PasscodeNotSet" : @" NotEnrolled" ;
240262 break ;
263+ #pragma clang diagnostic push
264+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
265+ // TODO(stuartmorgan): Remove the pragma and s/TouchID/Biometry/ in this constant when
266+ // iOS 10 support is dropped. The values are the same, only the names have changed.
241267 case LAErrorTouchIDLockout:
268+ #pragma clang diagnostic pop
242269 [self alertMessage: arguments[@" lockOut" ]
243270 firstButton: arguments[@" okButton" ]
244271 flutterResult: result
0 commit comments