The Browser API provides methods to open URLs in different browser contexts, including the system’s default browser, an in-app browser window, or a secure authentication session for OAuth flows.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NativePHP/mobile-air/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Open a URL in the system browser:Methods
open(string $url)
Opens a URL in the device’s default system browser (Safari on iOS, Chrome/default on Android).
Parameters:
$url(string) - The URL to open
bool - True if successfully opened
Example:
inApp(string $url)
Opens a URL in an in-app browser window that remains within your application.
Parameters:
$url(string) - The URL to open (must be a valid URL)
bool - True if successfully opened
Throws: InvalidArgumentException - If URL is invalid
Example:
iOS: Uses
SFSafariViewController which provides a Safari-like experience
Android: Uses Chrome Custom Tabs for a seamless browsing experienceauth(string $url)
Opens a URL in a secure authentication session, ideal for OAuth flows and social login.
Parameters:
$url(string) - The authentication URL to open
bool - True if successfully opened
Example:
This method automatically handles OAuth callbacks using your configured deeplink scheme. The authentication session will close automatically when the callback URL is triggered.
Examples
Opening External Links
OAuth Authentication Flow
Error Handling
In-App Help System
Social Sharing
Platform Notes
iOS
open()
- Opens URLs in Safari
- User leaves your app temporarily
- Can return via app switcher or back button
inApp()
- Uses
SFSafariViewController - Provides Safari features (Reader mode, autofill, etc.)
- User stays within your app context
- Has a “Done” button to dismiss
- Shares cookies with Safari
auth()
- Uses
ASWebAuthenticationSession - Secure and sandboxed environment
- Automatically handles callback URLs
- Shows a permission dialog on first use
- Best for OAuth and social login flows
Android
open()
- Opens URLs in default browser (usually Chrome)
- User leaves your app
- Returns via back button or app switcher
inApp()
- Uses Chrome Custom Tabs
- Faster loading (browser pre-warmed)
- Maintains browser session
- Smooth animations
- Has a close button
auth()
- Uses Chrome Custom Tabs with callback handling
- Secure OAuth flow
- Automatically closes on callback
- Handles deeplink redirection
For OAuth flows, make sure your app’s deeplink scheme is properly configured in your app configuration. The
auth() method relies on this to handle callbacks correctly.