nativephp/mobile-browser
Composer 安装命令:
composer require nativephp/mobile-browser
包简介
Browser functionality for NativePHP Mobile - open URLs in system browser, in-app browser, and OAuth authentication
README 文档
README
Open URLs in system browser, in-app browser (SFSafariViewController/Chrome Custom Tabs), and OAuth authentication sessions.
Overview
The Browser API provides three methods for opening URLs, each designed for specific use cases: in-app browsing, system browser navigation, and web authentication flows.
Installation
composer require nativephp/mobile-browser
Usage
PHP (Livewire/Blade)
use Native\Mobile\Facades\Browser; // Open in in-app browser Browser::inApp('https://nativephp.com/mobile'); // Open in system browser Browser::open('https://nativephp.com/mobile'); // OAuth authentication Browser::auth('https://provider.com/oauth/authorize?client_id=123&redirect_uri=nativephp://127.0.0.1/auth/callback');
JavaScript (Vue/React/Inertia)
import { Browser } from '#nativephp'; // Open in in-app browser await Browser.inApp('https://nativephp.com/mobile'); // Open in system browser await Browser.open('https://nativephp.com/mobile'); // OAuth authentication await Browser.auth('https://provider.com/oauth/authorize?client_id=123&redirect_uri=nativephp://127.0.0.1/auth/callback');
Methods
inApp()
Opens a URL in an embedded browser within your app using Custom Tabs (Android) or SFSafariViewController (iOS).
open()
Opens a URL in the device's default browser app, leaving your application entirely.
auth()
Opens a URL in a specialized authentication browser designed for OAuth flows with automatic nativephp:// redirect handling.
Use Cases
When to Use Each Method
inApp() - Keep users within your app experience:
- Documentation, help pages, terms of service
- External content that relates to your app
- When you want users to easily return to your app
open() - Full browser experience needed:
- Complex web applications
- Content requiring specific browser features
- When users need bookmarking or sharing capabilities
auth() - OAuth authentication flows:
- Login with WorkOS, Auth0, Google, Facebook, etc.
- Secure authentication with automatic redirects
- Isolated browser session for security
nativephp/mobile-browser 适用场景与选型建议
nativephp/mobile-browser 是一款 基于 Swift 开发的 Composer 扩展包,目前已累计 5.62k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2026 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nativephp/mobile-browser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nativephp/mobile-browser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-22