Close IAB when it triggers an intent (#8454)

* Close IAB if it opens a link to the app

* native only

* await close
This commit is contained in:
Samuel Newman
2025-10-28 17:52:09 +02:00
committed by GitHub
parent 5cff45bdc8
commit 1883f3fc7b
+7 -1
View File
@@ -1,6 +1,7 @@
import React from 'react'
import {Alert} from 'react-native'
import * as Linking from 'expo-linking'
import * as WebBrowser from 'expo-web-browser'
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
import {logger} from '#/logger'
@@ -32,7 +33,12 @@ export function useIntentHandler() {
const {tryApplyUpdate} = useApplyPullRequestOTAUpdate()
React.useEffect(() => {
const handleIncomingURL = (url: string) => {
const handleIncomingURL = async (url: string) => {
if (isNative) {
// Close in-app browser if it's open
await WebBrowser.dismissBrowser().catch(() => {})
}
const referrerInfo = Referrer.getReferrerInfo()
if (referrerInfo && referrerInfo.hostname !== 'bsky.app') {
logger.metric('deepLink:referrerReceived', {