Add deep link handling for Android app

This commit is contained in:
MartinBraquet
2026-04-02 09:23:52 +02:00
parent c4fb694c71
commit 7565d373e9
2 changed files with 16 additions and 5 deletions

View File

@@ -22,6 +22,16 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="compassmeet.com" />
<data android:scheme="https" />
<data android:host="www.compassmeet.com" />
</intent-filter>
<!-- <intent-filter>-->
<!-- <action android:name="openapp" />-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->

View File

@@ -150,13 +150,14 @@ function MyApp(props: AppProps<PageProps>) {
}, [router])
useEffect(() => {
const bridgeRedirect = (payload: any) => {
debug('bridgeRedirect', payload)
const handleAppLink = (payload: any) => {
debug('handleAppLink', payload)
const {endpoint} = payload
router.push(endpoint)
if (endpoint) {
router.push(endpoint)
}
}
// Expose globally for native bridge
;(window as any).bridgeRedirect = bridgeRedirect
;(window as any).handleAppLink = handleAppLink
}, [])
const title = 'Compass'