How to suppress or modify the popup from WebBrowser.openAuthSessionAsync()

Please provide the following:

  1. SDK Version: 46
  2. Platforms(Android/iOS/web/all): iOS

On iOS, whenever I invoke “WebBrowser.openAuthSessionAsync()” or “AuthRequest.promptAsync()” the following popup appears:

Screen Shot 2022-10-13 at 7.35.44 PM

Two questions:

  1. Is there a way to prevent this popup from appearing every time?
  2. Am I able to modify any part of the popup’s text?

I figured it out. I had to specify “preferEphemeral: true” in order to work around and prevent the popup showing up. However, initially I didn’t even realize it could be provided through “promptAsync()”.

Since “AuthRequest.promptAsync()” uses “WebBrowser.openAuthSessionAsync()” under the hood, from digging into the implementation of “AuthRequest.promptAsync()” in the expo-auth-session library it turns out that the “options” parameter of “promptAsync()” can actually have the same interface as “WebBrowser.openAuthSessionAsync()” despite the documentation not indicating it.

From the documentation:

  • WebBrowser - Expo Documentation
    • “preferEphemeralSession” is listed as a property of the type “AuthSessionOpenOptions”, which extends “WebBrowserOpenOptions”.
  • AuthSession - Expo Documentation
    • “promptAsync()” accepts a parameter of type “AuthRequestPromptOptions”.
    • “AuthRequestPromptOptions” is indicated as an extension of “WebBrowserOpenOptions” with one property removed and a handful of properties added, none of which are “preferEphemeralSession”.

In actuality, “AuthRequestPromptOptions” extends “AuthSessionOpenOptions”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.