tapOnNotificationByIndex method

Future<void> tapOnNotificationByIndex(
  1. int index, {
  2. Duration? timeout,
})

Searches for the index-th visible notification and taps on it.

If the notification is not visible immediately, this method waits for the notification to become visible for timeout duration. If timeout is not specified, it utilizes the NativeAutomatorConfig.findTimeout duration from the configuration.

Notification shade has to be opened first with openNotifications.

See also:

Implementation

Future<void> tapOnNotificationByIndex(
  int index, {
  Duration? timeout,
}) async {
  await _wrapRequest(
    'tapOnNotificationByIndex',
    () => _client.tapOnNotification(
      TapOnNotificationRequest(
        index: index,
        timeoutMillis: timeout?.inMilliseconds,
      ),
    ),
  );
}