mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-02 22:15:23 -04:00
Add deep link handling for Android app
This commit is contained in:
@@ -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" />-->
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user