This capability helps Appium to automatically determine the permissions required by a particular app and grants these permissions to the app on install:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("autoGrantPermissions","true");
For iOS, the autoAcceptAlerts capability accepts all iOS alerts if they pop up. This includes permission alerts for location, photos, camera, and so on. This works only on the XCUITest or UIAutomation drivers.