rajen/nativephp-url-launcher
Composer 安装命令:
composer require rajen/nativephp-url-launcher
包简介
Native external URL and deep link launcher for NativePHP applications.
README 文档
README
A NativePHP Mobile plugin for communicating with device functionalities like the browser, phone dialer, SMS, map apps, and deep linking schemes.
Similar to Flutter's url_launcher, but tailored for NativePHP mobile.
Browser functionalities are already provided by NativePHP, so this plugin is only for other functionalities, for browser functionalities use NativePHP Mobile Borwser
Requirements
- PHP 8.2+
- Laravel 11+
- NativePHP Mobile ^3.0
Installation
composer require rajen/nativephp-url-launcher
Publish the configuration file:
php artisan vendor:publish --tag="nativephp-url-launcher-config"
Basic Usage
The plugin exposes a Laravel Facade, making it extremely easy to use:
use Rajen\UrlLauncher\Facades\UrlLauncher; // Send an email UrlLauncher::openEmail('hello@nativephp.com', 'Support Request', 'Hello from my app!'); // Dial a phone number UrlLauncher::openPhone('+1234567890'); // Send an SMS UrlLauncher::openSms('+1234567890', 'Please reply to this message.'); // Open WhatsApp UrlLauncher::openWhatsApp('+1234567890', 'Hello!'); // Open Maps UrlLauncher::openMap('London, UK'); // Open custom app deep link UrlLauncher::openCustomScheme('myapp://product/123'); // Check if a URL can be launched if (UrlLauncher::canLaunch('twitter://user?screen_name=NativePHP')) { UrlLauncher::launch('twitter://user?screen_name=NativePHP'); }
Deep Linking Configuration
If your app needs to trigger external deep links (e.g. twitter://, whatsapp://) or needs to handle returns back into your app via Custom Schemes (myapp://), you must configure the native project manifests.
Android Setup (AndroidManifest.xml)
Add the following <queries> to your manifest if you are targeting Android 11+ to canLaunch other apps:
<manifest package="com.your.app"> <queries> <!-- For WhatsApp --> <package android:name="com.whatsapp" /> <!-- For Emails --> <intent> <action android:name="android.intent.action.SENDTO" /> <data android:scheme="mailto" /> </intent> <!-- For Custom apps --> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="twitter" /> </intent> </queries> </manifest>
iOS Setup (Info.plist)
For iOS, you need to whitelist URL schemes your app wants to open using LSApplicationQueriesSchemes.
Add this to your Info.plist:
<key>LSApplicationQueriesSchemes</key> <array> <string>whatsapp</string> <string>twitter</string> <string>mailto</string> <string>tel</string> <string>sms</string> </array>
Listening for Returns / Deep Links
You can listen to URL Launcher events using standard Laravel Event listeners:
Rajen\UrlLauncher\Events\UrlLaunchedRajen\UrlLauncher\Events\UrlLaunchFailedRajen\UrlLauncher\Events\DeepLinkReceivedRajen\UrlLauncher\Events\UrlLaunchCompletedIlluminate\Support\Facades\Event
Example:
use Rajen\UrlLauncher\Events\UrlLaunched; use Rajen\UrlLauncher\Events\UrlLaunchFailed; use Rajen\UrlLauncher\Events\DeepLinkReceived; use Rajen\UrlLauncher\Events\UrlLaunchCompleted; use Illuminate\Support\Facades\Event; Event::listen(function (DeepLinkReceived $event) { // do something });
License
MIT
Support
For questions, feature requests, or issues, please contact laravel.rajen@gmail.com.
rajen/nativephp-url-launcher 适用场景与选型建议
rajen/nativephp-url-launcher 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「url」 「mobile」 「android」 「ios」 「deep-link」 「nativephp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rajen/nativephp-url-launcher 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rajen/nativephp-url-launcher 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rajen/nativephp-url-launcher 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Beyonic PHP Library
Easy URL rewrites in your Laravel application
Firebase cloud messaging http v1 php
Standalone PHP library for easy devices notifications push.
The skeleton application for NativePHP for Mobile.
A Laravel helper to detect if the current route/path is active.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-22