Skip to content
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

Merged
merged 5 commits into from
Oct 9, 2024

Conversation

haileyok
Copy link
Member

@haileyok haileyok commented Oct 9, 2024

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.

@arcalinea arcalinea temporarily deployed to hailey/edge-case-starterpack - social-app PR #5664 October 9, 2024 21:35 — with Render Destroyed
Copy link

github-actions bot commented Oct 9, 2024

Old size New size Diff
7.89 MB 7.89 MB 361 B (0.00%)

@arcalinea arcalinea temporarily deployed to hailey/edge-case-starterpack - social-app PR #5664 October 9, 2024 22:11 — with Render Destroyed
Comment on lines +42 to +49
if (isWeb && !currentAccount) {
const getParams = new URLSearchParams(window.location.search)
const splash = getParams.get('splash')
if (splash === 'true') {
setShowLoggedOut(true)
return
}
}
Copy link
Member Author

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.

Comment on lines +34 to +40
React.useEffect(() => {
const getParams = new URLSearchParams(window.location.search)
const clip = getParams.get('clip')
if (clip === 'true') {
setShowClipOverlay(true)
}
}, [])
Copy link
Member Author

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.

Comment on lines +89 to +104
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
}
}
Copy link
Member Author

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")!))
Copy link
Member Author

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

@arcalinea arcalinea temporarily deployed to hailey/edge-case-starterpack - social-app PR #5664 October 9, 2024 22:19 — with Render Destroyed
Copy link
Member

@estrattonbailey estrattonbailey left a 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!

@haileyok haileyok merged commit 2841944 into main Oct 9, 2024
6 checks passed
@haileyok haileyok deleted the hailey/edge-case-starterpack branch October 9, 2024 22:29
haileyok added a commit that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants