setTouchIDAuthenticationAllowableReuseDuration method

  1. @override
Future<double> setTouchIDAuthenticationAllowableReuseDuration(
  1. double duration
)
override

Sets the allowable reuse duration for Touch ID authentication (iOS only).

On iOS, this method allows you to specify the allowable duration for reusing a previously authenticated Touch ID (fingerprint) to unlock an app or perform secure actions. This duration is specified in seconds.

This method is applicable only to iOS platforms. On other platforms, it returns 0.0.

Parameters:

  • duration: The allowable reuse duration in seconds.

Returns a Future with a double value representing the allowable reuse duration. If the operation is successful, it returns the specified duration value. If the method is not supported on the current platform, it returns 0.0.

Throws an exception if there's an issue with setting the allowable reuse duration or if it's not supported on the current platform.

Implementation

@override
Future<double> setTouchIDAuthenticationAllowableReuseDuration(
    double duration) async {
  return await methodChannel.invokeMethod<double>(
          'setTouchIDAuthenticationAllowableReuseDuration',
          {"duration": duration}) ??
      0.0;
}