You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Browser API documentation with new methods and improved structure
- Add system() method for opening URLs in device's default browser
- Add auth() method for OAuth authentication flows with nativephp:// handling
- Update inApp() method description with platform-specific details
- Add comprehensive use cases for each browser method
- Include platform behavior notes for iOS and Android implementations
- Remove redundant sections and streamline documentation
- Update examples to demonstrate all three browser methods
Copy file name to clipboardExpand all lines: resources/views/docs/mobile/1/apis/browser.md
+29-50Lines changed: 29 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ order: 250
5
5
6
6
## Overview
7
7
8
-
The Browser API allows you to open URLs in an in-app browser that is "owned" by your application. This is essential when working with OAuth redirects since you need to provide a redirect URL that would naturally open in the user's default browser.
8
+
The Browser API provides three methods for opening URLs in mobile apps, each designed for specific use cases: in-app browsing, system browser navigation, and OAuth authentication flows.
9
9
10
10
```php
11
11
use Native\Mobile\Facades\Browser;
@@ -15,72 +15,51 @@ use Native\Mobile\Facades\Browser;
15
15
16
16
### `inApp()`
17
17
18
-
Opens a URL in an in-app browser window.
19
-
20
-
**Parameters:**
21
-
-`string $url` - The URL to open in the in-app browser
18
+
Opens a URL in an embedded browser within your app using Custom Tabs (Android) or SFSafariViewController (iOS).
22
19
23
20
```php
24
21
Browser::inApp('https://nativephp.com/mobile');
25
22
```
26
23
27
-
## Use Cases
28
-
29
-
### OAuth Authentication
24
+
### `system()`
30
25
31
-
The in-app browser is particularly useful for OAuth flows where you need to:
32
-
- Redirect users to a third-party authentication provider
33
-
- Capture the redirect URL after authentication
34
-
- Return control to your app seamlessly
26
+
Opens a URL in the device's default browser app, leaving your application entirely.
0 commit comments