1. In the Capabilities callback set these flags
caps["safariAllowPopups"] = true;
caps["autoAcceptAlerts"] = true;
First flag enables the prompt. The second - auto accepts it. The downside of this approach is that all alerts will be auto accepted.
2. Use this function whenever you need to accept an alert
function AcceptAlert()
{
WebDriver.SwitchToAlert().Accept();
WebDriver.SwitchToParentFrame();
}
Example in RVL

3. If you want to check the Alert text then use Navigator.DoCheckAlert. It will accept the alert if it's text matches the specified string.
https://rapisedoc.inflectra.com/Libraries/Navigator/#docheckalert

JavaScript version
Navigator.DoCheckAlert("This site is attempting to open a pop-up window");
Note: Appium may be slow dismissing alerts but it works.