Safari
Open URLs in Safari browser
Safari provides methods to open URLs in the Safari app or an in-app browser.
Use Safari to:
Note: Not available in widgets.
Examples
javascript
Safari.open("https://apple.com");javascript
await Safari.openInApp("https://apple.com");
await Safari.openInApp("https://apple.com", true); // fullscreenMethods
openInApp
Open URL in an in-app browser sheet
Shows a SFSafariViewController overlay. Not available in widgets.
typescript
static openInApp(url, fullscreen): voidurl- URL to openfullscreen- Whether to show fullscreen (default: true)
Returns: Promise resolving to true if opened successfully
Example:
javascript
await Safari.openInApp("https://example.com")open
Open URL in external Safari app
Switches to the Safari app. Not available in widgets.
typescript
static open(url): voidurl- URL to open
Example:
javascript
Safari.open("https://example.com")