tapOnNotificationByIndex method
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:
- tapOnNotificationBySelector, which allows for more precise specification of the notification to tap on
Implementation
Future<void> tapOnNotificationByIndex(
int index, {
Duration? timeout,
}) async {
await _wrapRequest(
'tapOnNotificationByIndex',
() => _client.tapOnNotification(
TapOnNotificationRequest(
index: index,
timeoutMillis: timeout?.inMilliseconds,
),
),
);
}