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

Conference deep link for Android #1214

Merged
merged 11 commits into from
Apr 7, 2024
Merged

Conversation

StylianosGakis
Copy link
Collaborator

@StylianosGakis StylianosGakis commented Mar 29, 2024

This now handles intents that look like

https://confetti-app.dev/conference/kotlinconf2023
https://confetti-app.dev/conference/androidmakers2024
https://confetti-app.dev/conference/shedevwarsaw2024
https://confetti-app.dev/conference/devfeststockholm2023

A̶s̶ ̶d̶e̶s̶c̶r̶i̶b̶e̶d̶ ̶h̶e̶r̶e̶ ̶h̶o̶w̶e̶v̶e̶r̶ ̶h̶t̶t̶p̶s̶:̶/̶/̶d̶e̶v̶e̶l̶o̶p̶e̶r̶.̶a̶n̶d̶r̶o̶i̶d̶.̶c̶o̶m̶/̶t̶r̶a̶i̶n̶i̶n̶g̶/̶a̶p̶p̶-̶l̶i̶n̶k̶s̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶j̶u̶s̶t̶ ̶a̶ ̶d̶e̶e̶p̶ ̶l̶i̶n̶k̶ ̶w̶h̶i̶c̶h̶ ̶m̶e̶a̶n̶s̶ ̶t̶h̶a̶t̶ ̶I̶ ̶d̶o̶n̶'̶t̶ ̶t̶h̶i̶n̶k̶ ̶s̶o̶m̶e̶o̶n̶e̶ ̶w̶i̶l̶l̶ ̶b̶e̶ ̶a̶b̶l̶e̶ ̶t̶o̶ ̶j̶u̶s̶t̶ ̶c̶l̶i̶c̶k̶ ̶i̶t̶ ̶a̶n̶d̶ ̶h̶a̶v̶e̶ ̶c̶o̶n̶f̶e̶t̶t̶i̶ ̶o̶p̶e̶n̶ ̶f̶o̶r̶ ̶t̶h̶e̶m̶.̶ ̶F̶o̶r̶ ̶t̶h̶a̶t̶ ̶w̶e̶'̶d̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶m̶a̶k̶e̶ ̶a̶p̶p̶ ̶l̶i̶n̶k̶s̶ ̶a̶s̶ ̶s̶p̶e̶c̶i̶f̶i̶e̶d̶ ̶h̶e̶r̶e̶ ̶h̶t̶t̶p̶s̶:̶/̶/̶d̶e̶v̶e̶l̶o̶p̶e̶r̶.̶a̶n̶d̶r̶o̶i̶d̶.̶c̶o̶m̶/̶t̶r̶a̶i̶n̶i̶n̶g̶/̶a̶p̶p̶-̶l̶i̶n̶k̶s̶#̶a̶d̶d̶-̶a̶p̶p̶-̶l̶i̶n̶k̶s̶ ̶A̶n̶d̶ ̶t̶h̶e̶n̶ ̶t̶h̶e̶r̶e̶ ̶a̶r̶e̶ ̶s̶o̶m̶e̶ ̶m̶o̶r̶e̶ ̶s̶t̶e̶p̶s̶ ̶t̶h̶a̶t̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶b̶e̶ ̶d̶o̶n̶e̶ ̶t̶o̶ ̶v̶e̶r̶i̶f̶y̶ ̶o̶u̶r̶ ̶o̶w̶n̶e̶r̶s̶h̶i̶p̶ ̶o̶f̶ ̶t̶h̶a̶t̶ ̶l̶i̶n̶k̶ ̶a̶n̶d̶ ̶s̶o̶ ̶o̶n̶.̶ ̶I̶ ̶a̶m̶ ̶n̶o̶t̶ ̶s̶u̶r̶e̶ ̶i̶f̶ ̶w̶e̶ ̶h̶a̶v̶e̶ ̶s̶o̶m̶e̶ ̶u̶r̶l̶ ̶f̶o̶r̶ ̶C̶o̶n̶f̶e̶t̶t̶i̶ ̶a̶s̶ ̶a̶ ̶w̶h̶o̶l̶e̶ ̶s̶o̶ ̶t̶h̶a̶t̶ ̶I̶ ̶w̶o̶u̶l̶d̶ ̶k̶n̶o̶w̶ ̶h̶o̶w̶ ̶t̶h̶o̶s̶e̶ ̶d̶e̶e̶p̶ ̶l̶i̶n̶k̶s̶ ̶s̶h̶o̶u̶l̶d̶ ̶l̶o̶o̶k̶ ̶l̶i̶k̶e̶.̶

As described here
https://developer.android.com/training/app-links
We are using the result of this PR https://github.com/joreilly/Confetti/pull/1215/files to support autoVerify and have the app automatically pick up these links.

Keeping it as a draft until I get some feedback on this. Until then the implementation itself can be reviewed if there's anything else that we need to do here. I hooked the initial id to the AppComponent which takes over instead of looking at the local preferences and if there was some conference selected in the past. At the same time it also saves this conference to storage.

The one other thing which this does not handle well is the color scheme of the conference itself. I believe there's room for the color to be implicitly linked with a conference ID so that a deep link can just pick it up from there, instead of having to know the color as you are setting the selected conference. Maybe something to consider as a PR on top of this, depends on what you think about it too.

p.s If deep links exist, someone could definitely try to deep link to /asd123a for example. It may be a good idea to also possibly show a special error message in those scenarios when the backend successfully responds with no conference information. Or we might have to tweak backend to respond in a special way, with a special error in the response for example for those cases.

StylianosGakis and others added 7 commits March 29, 2024 14:39
As specified here
https://developer.android.com/training/app-links
Handles links that look like `confetti://conference/{conferenceId}`.
I'll make a separate PR
This reverts commit 4e3f302.
Also turn autoVerify to "true", which along with this PR should not
require anyone to manually do anything for Confetti to handle those
links.
@martinbonnin martinbonnin mentioned this pull request Mar 29, 2024
@StylianosGakis StylianosGakis marked this pull request as ready for review March 29, 2024 19:37
@StylianosGakis StylianosGakis changed the title Conference deep link draft Conference deep link for Android Mar 29, 2024
This prevents the problem of trying to handle the deep link again after
this scenario:
We open the app with a deep link
We navigate somewhere else in the app
Then we go home
The process is killed in the background
Then we go to the recents screen and we open the app again
In this case, the original deep link is delivered again to the app

This was breaking the behavior of restoring the state properly when
coming back into the app after a process death after having opened the
app with a deep link prior to that
@joreilly joreilly merged commit f6e277e into main Apr 7, 2024
5 checks passed
@joreilly joreilly deleted the stylianos/conference-deep-link branch April 7, 2024 19:07
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