How to push app in background for both iOS and Android

Hi ,
After updating the Appium to latest version driver.runAppInBackground seems to be deprecated and one of the solution that i found is

For Android

((AndroidDriver) driver).runAppInBackground(Duration.ofSeconds(3));

For iOS

((IOSDriver) driver).runAppInBackground(Duration.ofSeconds(3));

So is there simpler way were i could put app in background on both the OS instead of calling them separately

((InteractsWithApps) driver).runAppInBackground(duration);
1 Like