capacitor-deep-linking
БесплатноБез исполняемых скриптовНе проверенImplements and debugs deep links in Capacitor apps - custom URL schemes, iOS Universal Links (apple-app-site-association, Associated Domains entitlement)…
от Cap-go★ 79 звёзд на GitHubОб этом скилле
Deep Linking in Capacitor
Route custom-scheme links, iOS Universal Links, and Android App Links into the web app.
When to Use
TRIGGER when:
- Adding
myapp://schemes, Universal Links, or App Links to a Capacitor app - Links open the browser instead of the app, or open the app but land on the home page
appUrlOpenfires on warm open but the URL is missing on cold launch (or the reverse)- Deep links broke after updating to Capacitor 8.5+ / adopting
SceneDelegate.swift - OAuth / magic-link / payment redirects must come back into the app
adb shell pm get-app-linksshowsnoneor1024instead ofverified
Do not use:
- Full AppDelegate -> SceneDelegate migration of an app:
capacitor-uiscene-migration - Notification tap routing:
capacitor-push-notifications - Native log capture while debugging:
ios-android-logs - Sign in with Apple / Google plugin config:
capacitor-plugins
Link Types
| Type | Platform | Format | Needs hosted file | Verified ownership |
|---|---|---|---|---|
| Custom scheme | both | myapp://product/123 |
no | no (any app can claim it) |
| Universal Links | iOS | https://example.com/product/123 |
/.well-known/apple-app-site-association |
yes |
| App Links | Android 6+ | https://example.com/product/123 |
/.well-known/assetlinks.json |
yes |
Prefer verified https links for anything security-sensitive (OAuth, magic links). Custom schemes can be hijacked by another app.
Workflow
- Inspect first. Read
capacitor.config.*,ios/App/App/Info.plist,ios/App/App/*.entitlements,ios/App/App/AppDelegate.swift,ios/App/App/SceneDelegate.swift(if present),android/app/src/main/AndroidManifest.xml, and the@capacitor/appversion inpackage.json. - Decide the iOS lifecycle path.
UIApplicationSceneManifestpresent in Info.plist (Capacitor 8.5+ template or migrated app) -> URL events arrive inSceneDelegate. Any custom code in AppDelegateapplication(_:open:options:)orapplication(_:continue:restorationHandler:)is dead code. See references/ios-scene-delegate.md.- No scene manifest -> AppDelegate path still works on 8.5 core, but Xcode 27 / Capacitor 9 require the scene lifecycle. Hand the migration to
capacitor-uiscene-migration.
- Install
@capacitor/app(npm install @capacitor/app && npx cap sync). - Register the JS handler once, at app bootstrap (before the router renders), using both
appUrlOpenandgetLaunchUrl(). See below. - Configure platforms: custom scheme (Info.plist
CFBundleURLTypes, Android<intent-filter>), then verified links per platform:- iOS Universal Links: references/ios-universal-links.md
- Android App Links: references/android-app-links.md
- Route in the framework router: references/routing-patterns.md (React, Vue, Angular, OAuth callbacks, deferred links).
- Verify with the cold/warm matrix below on a real device.
Only load a reference when its topic is in play.
JS Handler (the part every app needs)
import { App, type URLOpenListenerEvent } from '@capacitor/app';
let lastHandled: string | undefined;
function route(rawUrl: string) {
if (rawUrl === lastHandled) return; // cold start can deliver the same URL to both paths
lastHandled = rawUrl;
const url = new URL(rawUrl);
// myapp://product/123 -> host "product", pathname "/123"
// https://example.com/product/123 -> pathname "/product/123"
const path = url.protocol.startsWith('http')
? url.pathname
: `/${url.host}${url.pathname}`;
router.navigate(path + url.search); // your router
}
export async function initDeepLinks() {
await App.addListener('appUrlOpen', (event: URLOpenListenerEvent) => route(event.url));
const launch = await App.getLaunchUrl(); // resolves undefined or { url }
if (launch?.url) route(launch.url);
}
Traps:
- Custom scheme URLs parse with the first segment as
host, notpathname. Normalize both forms as above. - Register the listener at bootstrap, not inside a lazily loaded page. A listener added after the event fired never sees it;
getLaunchUrl()is the fallback for cold start. - Wrap state updates from the listener in your framework's zone/run loop (Angular
NgZone.run) or navigation silently does nothing. - Dedupe: on cold start the URL can be reachable via both
getLaunchUrl()andappUrlOpen. - Validate and allow-list paths before navigating; a deep link is untrusted input.
Custom Scheme Config
iOS ios/App/App/Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.example.app</string>
<key>CFBundleURLSchemes</key>
<array><string>myapp</string></array>
</dict>
</array>
Android AndroidManifest.xml, inside the existing MainActivity (keep the template's `an
Установить capacitor-deep-linking в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл capacitor-deep-linking?
Implements and debugs deep links in Capacitor apps - custom URL schemes, iOS Universal Links (apple-app-site-association, Associated Domains entitlement), Android App Links (assetlinks.json, autoVerify), and routing via @capacitor/app `appUrlOpen` + `App.getLaunchUrl()`. Covers the Capacitor 8.5+ UIScene change where AppDelegate `application(_:open:options:)` and `continue userActivity` stop being called and custom handling must move to SceneDelegate, plus cold vs warm launch testing. Use when links open Safari/Chrome instead of the app, `appUrlOpen` never fires, the launch URL is lost on cold start, or OAuth redirects do not return to the app. Do not use for the full UIScene migration (capacitor-uiscene-migration), push notification taps (capacitor-push-notifications), or social login plugin setup (capacitor-plugins).
Как установить скилл capacitor-deep-linking?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл capacitor-deep-linking запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic