Deep linking in NativePHP + Laravel + Inertia (React) always opens home and not target route #46
Unanswered
MurtazaD1410
asked this question in
Q&A
Replies: 1 comment
-
|
Hi @MurtazaD1410 Thanks for reporting. Deep links work but perhaps a bit differently than you might assume. It's a undocumented feature right now. Making a mental note to document this 😅 You need to listen to a This might seem strange but is intentional. Devs might want to do something else entirely than routing to a specific page when a deep link has been visited. Hope that clarifies things! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What were you trying to do?
Description
When using NativePHP (Electron) with Laravel 12 and Inertia React, the built-in deep link handler (setDeepLinkHandler) doesn’t correctly route to the intended URL within the app.
If the app is closed, the deep link successfully opens the app, but always loads the default dashboard instead of the target route.
If the app is already open, the app window focuses (as expected), but no navigation occurs — it stays on the current page.
What happened?
Expected Behavior
The deep link (e.g. deeplinkprotocol://settings/worktime) should cause:
Laravel/Inertia to load the corresponding route (/settings/worktime) when the app starts.
Or, if the app is already running, it should trigger a frontend navigation to that route.
Actual Behavior
The application always opens the default dashboard/home.
When already open, the deep link only focuses the window — it doesn’t trigger route navigation.
How to reproduce the bug
Steps To Reproduce
Create a NativePHP + Laravel 12 project using Inertia (React).
Keep the default deep link handler:
`private setDeepLinkHandler(config) {
const deepLinkProtocol = config?.deeplink_scheme;
}`
Create a test HTML file with:
<a href="#" onclick="event.preventDefault(); window.location.href='deeplinkprotocol://settings/worktime';"> Open MyApp </a>With the app closed, click the link — app opens, but only shows home.
With the app open, click the link — app focuses, but does not navigate.
Debug Output
It seems the OpenedFromURL event is not triggering a frontend (Inertia) route change.
Which operating systems have you seen this occur on?
windows
Notes
Laravel : 12.x
Inertia : 2.0 (React)
NativePHP : 2.0
OS : Windows
Beta Was this translation helpful? Give feedback.
All reactions