Intent handler (#2992)

* Handle URL params

* Add resources

* Add other params

* refactor for scope

* modify the pr to support intents rather than utm

remove linebreak

remove linebreak

handle web

adjust path check to work on web

add a short delay for opening the composer

setup compose intent, move to `intents` directory

fix intent logic

ignore incoming intents in the navigation router

* refactor

---------

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
Hailey 2024-02-27 10:35:38 -08:00 committed by GitHub
parent c8d02a791a
commit 2a04546c73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 88 additions and 1 deletions

View file

@ -460,7 +460,8 @@ const FlatNavigator = () => {
*/
const LINKING = {
prefixes: ['bsky://', 'https://bsky.app'],
// TODO figure out what we are going to use
prefixes: ['bsky://', 'bluesky://', 'https://bsky.app'],
getPathFromState(state: State) {
// find the current node in the navigation tree
@ -478,6 +479,11 @@ const LINKING = {
},
getStateFromPath(path: string) {
// Any time we receive a url that starts with `intent/` we want to ignore it here. It will be handled in the
// intent handler hook. We should check for the trailing slash, because if there isn't one then it isn't a valid
// intent
if (path.includes('intent/')) return
const [name, params] = router.matchPath(path)
if (isNative) {
if (name === 'Search') {