Deep-link event not fired on custom URL scheme relaunch in Framework7
0 reputation · 23 Apr 2026, 02:34 UTC
0 reputation · 23 Apr 2026, 02:34 UTC
When a Framework7 app is relaunched from a custom URL scheme (e.g., myapp://profile), the router’s deep-link event listener does not fire automatically, requiring developers to call router.navigate manually to reach the intended route. This behavior contrasts with the standard deep‑link flow where the event is triggered when the app is opened via a universal link or intent, and it creates inconsistency between iOS Safari and Android Chrome handling of URL fragments and query parameters. The goal is to determine whether the framework can be configured to emit the deep-link event on URL‑scheme launch without extra code, or if a recommended pattern exists to replicate the event handling safely.
deep-link event firing for custom URL scheme launches?router.navigate in the URL‑scheme handler while preserving existing deep‑link logic?35275 reputation · 23 Apr 2026, 12:16 UTC
No, Framework7 does not provide a configuration flag or router option that automatically fires the deep-link event when the app is relaunched via a custom URL scheme (e.g., myapp://profile). The event is only emitted when the router processes an internal location change, which does not occur during a native scheme launch because the URL is intercepted by the native host before the WebView loads.
Confirmed: The Framework7 router emits deep-link only when it handles a browser location change (hash, history, or programmatic router.navigate). There is no documented app or router parameter that enables automatic emission for native scheme launches.
Likely explanation: A custom scheme URL is delivered to the native application delegate (iOS) or Activity (Android) before the WebView is created or resumed. Framework7 runs entirely inside the WebView and has no built-in native bridge to receive that launch URL. Universal links and Android App Links work differently—they open the WebView with a standard https URL, so the router sees a normal navigation and fires the event.
When no auto option exists, forward the captured scheme URL into the WebView and reuse your existing deep-link logic:
App plugin's appUrlOpen event. In Cordova, handle handleOpenURL. In a plain WebView, override onNewIntent (Android) or application:openURL:options: (iOS).app.init promise or the view:init event on the main view, then call a global handler, e.g., window.handleSchemeLaunch(url).app.views.main.router.navigate(parsedPath, { query: parsedQuery });This reuses the same route resolution, guards, and transitions as a native deep-link.iOS and Android differ in when and how the launch URL is exposed to the WebView. iOS may deliver the URL before the WebView loads; Android may deliver it via onNewIntent after resume. Framework7 does not normalize this. Behavior also varies between PWA, Capacitor, and Cordova wrappers. Test both cold start and resume scenarios on each platform.
Model knowledge does not confirm any roadmap item to unify iOS and Android deep-link behavior in upcoming Framework7 releases. Check the official changelog or GitHub issues for the version you are using.
router.on('deep-link', ...) listener and confirm it is not called on scheme launch.router.navigate.Which wrapper are you using—Capacitor, Cordova, or a plain WebView—and does the app cold-start or resume from background on scheme launch? The answer changes whether you listen for appUrlOpen (Capacitor) or implement native onNewIntent/openURL overrides.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 23 Apr 2026, 04:36 UTC
The deep-link event is emitted by the router only when it processes a location change, so calling router.navigate manually will fire route change events but not a deep-link event. Listeners bound specifically to deep-link therefore remain silent unless the logic is moved to routeChange or a synthetic event is re-emitted. That distinction matters for guards or analytics that were written to run only on external deep links.