PHPackages                             mr-swapan/applinks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mr-swapan/applinks

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mr-swapan/applinks
==================

Redirect to mobile app with deeplink URL.

v2.0.6(1mo ago)016MITPHPPHP &gt;=8.0

Since Jul 16Pushed 3w agoCompare

[ Source](https://github.com/mr-swapan/applinks)[ Packagist](https://packagist.org/packages/mr-swapan/applinks)[ RSS](/packages/mr-swapan-applinks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (10)Used By (0)

Applinks (mr-swapan/applinks)
=============================

[](#applinks-mr-swapanapplinks)

Redirect users to your mobile app using deep links, with safe fallbacks to Play Store / App Store or a web URL. Includes endpoints for Android Digital Asset Links and Apple App Site Association.

Requirements
------------

[](#requirements)

- PHP `>= 8.0`
- Laravel `9.x` / `10.x` / `11.x` / `12.x`

Install
-------

[](#install)

```
composer require mr-swapan/applinks
```

The service provider is auto-discovered by Laravel.

Publish config &amp; migrations
-------------------------------

[](#publish-config--migrations)

```
php artisan vendor:publish --tag=applinks-config
php artisan vendor:publish --tag=applinks-migrations
php artisan migrate
```

Configuration
-------------

[](#configuration)

This package reads configuration from `config/applinks.php` (and the corresponding `.env` variables).

### Core

[](#core)

- `APPLINKS_PREFIX` (default: `applinks/*`)
- `APPLINKS_WEB` (default: `true`)
- `APPLINKS_WEB_URL` (default: empty; falls back to your app URL)
- `APPLINKS_DOMAIN` (optional; reserved for your associated domain value)

### Android

[](#android)

- `APPLINKS_ANDROID` (default: `true`)
- `ANDROID_PACKAGE` (example: `com.example.app`)
- `ANDROID_SHA256_CERT_FINGERPRINT` (your app signing SHA-256 fingerprint)
- `ANDROID_PLAYSTORE_URL` (example: `market://details?id=com.example.app`)

### iOS

[](#ios)

- `APPLINKS_IOS` (default: `true`)
- `IOS_TEAM_ID` (your Apple Team ID)
- `IOS_PACKAGE` (your app bundle id)
- `IOS_APP_CUSTOM_LINK` (example: `com.example.app://applinks`)
- `IOS_APPSTORE_URL` (your App Store URL)

What routes does it add?
------------------------

[](#what-routes-does-it-add)

Routes are loaded from `routes/web.php`:

- `/.well-known/assetlinks.json` and `/assetlinks.json`
- `/.well-known/apple-app-site-association` and `/apple-app-site-association`
- `/applinks/{any?}` (main redirect endpoint)
- `/applinks_save_device_info` (internal helper)
- `/get_app_link_parameters` (returns latest captured query params)
- `/js_editor` (simple JS eval page; do not expose publicly)

Creating an applinks URL
------------------------

[](#creating-an-applinks-url)

The package registers a singleton named `applinks` (class: `MrSwapan\Applinks\Services\ApplinksService`).

Example (controller, job, etc.):

```
$url = app('applinks')->create([
    'campaign' => 'summer',
    'user_id' => 123,
], webUrl: 'https://example.com/fallback');
```

This generates a URL like:

```
https://your-domain.test/applinks?campaign=summer&user_id=123&web_url=https%3A%2F%2Fexample.com%2Ffallback

```

When a user opens that link:

- **Android**: redirects to `ANDROID_PLAYSTORE_URL` and appends `&referrer=` (where `` is stored in `applinks_data`)
- **iOS**: tries to open `IOS_APP_CUSTOM_LINK` with the same query params; after ~30 seconds it falls back to `IOS_APPSTORE_URL`
- **Other devices**: redirects to `web_url` query param, or `APPLINKS_WEB_URL`, or your app URL

App association files
---------------------

[](#app-association-files)

### Android (Digital Asset Links)

[](#android-digital-asset-links)

Open `/.well-known/assetlinks.json` on your domain and verify it returns your:

- `ANDROID_PACKAGE`
- `ANDROID_SHA256_CERT_FINGERPRINT`

#### Android app configuration (required)

[](#android-app-configuration-required)

1. **Add an intent-filter for App Links** (Android 6.0+).

In your `AndroidManifest.xml` (inside the Activity you want to open):

```

```

Notes:

- `android:autoVerify="true"` asks Android to verify the domain ownership using `/.well-known/assetlinks.json`.
- `android:pathPrefix="/applinks"` should match your redirect path (default is `/applinks/...`).

2. **Get your signing certificate SHA-256 fingerprint** and set it as `ANDROID_SHA256_CERT_FINGERPRINT`.

Common ways to obtain the SHA-256:

- From Play Console (App Integrity / App signing)
- From your keystore using `keytool` (debug or release keystore)

3. **Ensure HTTPS is used** for your domain and that `/.well-known/assetlinks.json` is reachable publicly.
4. **Handle incoming links in your app**.

When the app is opened by an App Link, it receives the URL via the Activity intent data. Parse the query string to get the parameters you attached (e.g. `campaign`, `user_id`, etc.).

### iOS (Apple App Site Association)

[](#ios-apple-app-site-association)

Open `/.well-known/apple-app-site-association` and verify it returns:

- `IOS_TEAM_ID.IOS_PACKAGE`
- an `applinks` component pointing to your `APPLINKS_PREFIX`

#### iOS app configuration (required)

[](#ios-app-configuration-required)

1. **Enable Associated Domains** capability in Xcode.

In your app target:

- Signing &amp; Capabilities → `+ Capability` → **Associated Domains**

2. **Add your applinks domain entry**:

Add an entry like:

- `applinks:your-domain.com`

3. **Ensure `apple-app-site-association` is served correctly**.

This package provides:

- `/.well-known/apple-app-site-association`
- `/apple-app-site-association`

Notes:

- The response must be served over HTTPS.
- Apple expects no redirects for the `/.well-known/...` path.

4. **Handle Universal Links in the app**.

Implement handling for the incoming universal link URL and parse the query parameters you attached.

5. **iOS fallback behavior in this package**

If the request is detected as iOS, this package returns a small HTML page that:

- Attempts to open `IOS_APP_CUSTOM_LINK` with the same query string
- After ~30 seconds falls back to `IOS_APPSTORE_URL`

Set these values:

- `IOS_APP_CUSTOM_LINK` (your app’s custom URL scheme link, example: `com.example.app://applinks`)
- `IOS_APPSTORE_URL` (your App Store page URL)

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Recently: every ~2 days

Total

9

Last Release

31d ago

Major Versions

v1.0.0 → v2.0.02026-05-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/81e45c55b9ab431b13b1afda721455e65f840febd63085867209741d43d8b3fd?d=identicon)[mr-swapan](/maintainers/mr-swapan)

---

Top Contributors

[![swapankaramakar](https://avatars.githubusercontent.com/u/112679869?v=4)](https://github.com/swapankaramakar "swapankaramakar (14 commits)")[![mr-swapan](https://avatars.githubusercontent.com/u/155980260?v=4)](https://github.com/mr-swapan "mr-swapan (1 commits)")

### Embed Badge

![Health badge](/badges/mr-swapan-applinks/health.svg)

```
[![Health](https://phpackages.com/badges/mr-swapan-applinks/health.svg)](https://phpackages.com/packages/mr-swapan-applinks)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M145](/packages/laravel-mcp)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k11](/packages/laravel-surveyor)[api-platform/laravel

API Platform support for Laravel

58170.4k13](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
