定制 nativephp/mobile-browser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nativephp/mobile-browser

最新稳定版本:1.0.1

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

统计信息

  • 总下载量: 4.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: Swift

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固