-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure app clip works even with starter-pack
#5664
Conversation
|
if (isWeb && !currentAccount) { | ||
const getParams = new URLSearchParams(window.location.search) | ||
const splash = getParams.get('splash') | ||
if (splash === 'true') { | ||
setShowLoggedOut(true) | ||
return | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a way to show the splash screen on web when signed out, so we'll just add a splash
param that we can check.
React.useEffect(() => { | ||
const getParams = new URLSearchParams(window.location.search) | ||
const clip = getParams.get('clip') | ||
if (clip === 'true') { | ||
setShowClipOverlay(true) | ||
} | ||
}, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use clip=true
on the splash, we should show the app download overlay.
switch host { | ||
case "bsky.app": | ||
if url.pathComponents.count == 4, | ||
(url.pathComponents[1] == "start" || url.pathComponents[1] == "starter-pack") { | ||
return true | ||
} | ||
return false | ||
case "go.bsky.app": | ||
if url.pathComponents.count == 2 { | ||
return true | ||
} | ||
return false | ||
default: | ||
return false | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will catch all possibilities: go.bsky.app, bsky.app/start, and bsky.app/starter-pack.
self.webView?.load(URLRequest(url: url)) | ||
} | ||
} else { | ||
self.webView?.load(URLRequest(url: URL(string: "https://bsky.app/?splash=true&clip=true")!)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anything other than a real starterpack link comes in, we want to just send the user to the splash and present the appclip overlay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me!
(cherry picked from commit 2841944)
An unlikely edge case - which probably doesn't explain the thing Apple is seeing - that is possible to hit. The user would need to actually be signed in on web for this to be possible, since otherwise they'd get redirected to
/start
rather than/starter-pack
, but might as well fix it here.