Merge pull request #182 from coracle-social/flotilla-148-deep-linking

Add mobile deep linking support
This commit is contained in:
Matthew Remmel
2025-08-26 13:37:40 -04:00
committed by GitHub
5 changed files with 43 additions and 1 deletions
+8 -1
View File
@@ -5,7 +5,7 @@
import {onMount} from "svelte"
import * as nip19 from "nostr-tools/nip19"
import {get, derived} from "svelte/store"
import {App} from "@capacitor/app"
import {App, type URLOpenListenerEvent} from "@capacitor/app"
import {dev} from "$app/environment"
import {goto} from "$app/navigation"
import {sync, localStorageProvider} from "@welshman/store"
@@ -112,6 +112,13 @@
}
})
// Listen for deep link events
App.addListener("appUrlOpen", (event: URLOpenListenerEvent) => {
const url = new URL(event.url)
const target = `${url.pathname}${url.search}${url.hash}`
goto(target, {replaceState: false, noScroll: false})
})
// Nstart login
if (window.location.hash?.startsWith("#nostr-login")) {
const params = new URLSearchParams(window.location.hash.slice(1))