Merge pull request #182 from coracle-social/flotilla-148-deep-linking
Add mobile deep linking support
This commit is contained in:
commit
bcda637192
5 changed files with 43 additions and 1 deletions
|
|
@ -20,6 +20,13 @@
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</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" android:host="app.flotilla.social" />
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,9 @@
|
||||||
<dict>
|
<dict>
|
||||||
<key>aps-environment</key>
|
<key>aps-environment</key>
|
||||||
<string>development</string>
|
<string>development</string>
|
||||||
|
<key>com.apple.developer.associated-domains</key>
|
||||||
|
<array>
|
||||||
|
<string>applinks:app.flotilla.social</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
import {onMount} from "svelte"
|
import {onMount} from "svelte"
|
||||||
import * as nip19 from "nostr-tools/nip19"
|
import * as nip19 from "nostr-tools/nip19"
|
||||||
import {get, derived} from "svelte/store"
|
import {get, derived} from "svelte/store"
|
||||||
import {App} from "@capacitor/app"
|
import {App, type URLOpenListenerEvent} from "@capacitor/app"
|
||||||
import {dev} from "$app/environment"
|
import {dev} from "$app/environment"
|
||||||
import {goto} from "$app/navigation"
|
import {goto} from "$app/navigation"
|
||||||
import {sync, localStorageProvider} from "@welshman/store"
|
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
|
// Nstart login
|
||||||
if (window.location.hash?.startsWith("#nostr-login")) {
|
if (window.location.hash?.startsWith("#nostr-login")) {
|
||||||
const params = new URLSearchParams(window.location.hash.slice(1))
|
const params = new URLSearchParams(window.location.hash.slice(1))
|
||||||
|
|
|
||||||
11
static/.well-known/apple-app-site-association
Normal file
11
static/.well-known/apple-app-site-association
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"applinks": {
|
||||||
|
"apps": [],
|
||||||
|
"details": [
|
||||||
|
{
|
||||||
|
"appID": "S26U9DYW3A.social.flotilla",
|
||||||
|
"paths": ["*"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
13
static/.well-known/assetlinks.json
Normal file
13
static/.well-known/assetlinks.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||||
|
"target": {
|
||||||
|
"namespace": "android_app",
|
||||||
|
"package_name": "social.flotilla",
|
||||||
|
"sha256_cert_fingerprints": [
|
||||||
|
"D0:2A:2E:82:75:92:4D:E2:13:E8:46:B8:EA:09:15:17:7F:46:7B:D1:49:E3:12:60:F0:01:D3:EF:42:9B:A2:DA",
|
||||||
|
"6D:AF:68:3E:1C:A8:3A:4C:D8:85:73:E9:73:9E:2A:A9:44:C8:5D:56:15:4E:34:42:30:55:7C:FF:ED:4A:D7:8C"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
Reference in a new issue