John O'Reilly
03/28/2024, 8:30 PMStylianos Gakis
03/28/2024, 9:26 PMStylianos Gakis
03/29/2024, 2:32 PMadb shell am start -a android.intent.action.VIEW -d "<confetti://conference/androidmakers2024>"
But they are not clickable out in the wild if there’s just “confetti://conference/androidmakers2024”. As far as I understand.
I’ve done this before in our apps where I made autoVerify
work, by using firebase deep links, where they add the right .well_known files and so on. But in this context I don’t think I can do this alone since I don’t know if we have a url which we can do this for in the first place for Confetti.
If someone has initial thoughts on this I would be happy to hear it. I will try to look more into this soon.John O'Reilly
03/29/2024, 2:34 PMmbonnin
03/29/2024, 2:34 PMConference colors from a deep link aren’t knownYup, this seems like what @yschimke was also hinting at here https://github.com/joreilly/Confetti/pull/1176#issue-2175635103
mbonnin
03/29/2024, 2:35 PMI think we have URL we can use for this?For the
.well_known
stuff? I don't think we host anything but I can add thatmbonnin
03/29/2024, 2:36 PM<https://confetti-app.dev/conference/androidmakers2024>
mbonnin
03/29/2024, 2:37 PMmbonnin
03/29/2024, 2:40 PM.well_known
file to support confetti://
deep links?
This is only if we want https://
deep links but personally I'm fine supporting only confetti://
for the reasons abovembonnin
03/29/2024, 2:40 PMStylianos Gakis
03/29/2024, 3:48 PMconfetti://
, how do we for example attach the link to the tweet that John did? In a way that people can just click it and go to the right place inside the app?
That was my original use case here. Hence why I brought up the https link. If there's a way to make it work with the confetti scheme which I am unaware of them that would be amazing.mbonnin
03/29/2024, 4:14 PMmbonnin
03/29/2024, 4:16 PMandroid-app://
or something?Stylianos Gakis
03/29/2024, 4:24 PMmbonnin
03/29/2024, 4:24 PMmbonnin
03/29/2024, 4:27 PMconfetti://
works in Firefox 🙂mbonnin
03/29/2024, 4:27 PMmbonnin
03/29/2024, 4:28 PM.well_known
filembonnin
03/29/2024, 4:37 PMkeytool -list -v -keystore androidApp/release.keystore
mbonnin
03/29/2024, 4:44 PM.well-known
for the debug keystore (PR). You should be able to test in a few minutes. Apologies I mistakenly pushed to your branch and reverted after than.mbonnin
03/29/2024, 5:02 PMStylianos Gakis
03/29/2024, 5:03 PMhttps
The host should be <http://confetti-app.dev|confetti-app.dev>
Then from then on we are free to do whatever, so in this case the conference
I feel like makes sense, wdyt?mbonnin
03/29/2024, 5:04 PMStylianos Gakis
03/29/2024, 5:04 PMyschimke
03/29/2024, 5:35 PMStylianos Gakis
03/29/2024, 5:37 PMyschimke
03/29/2024, 5:40 PMyschimke
03/29/2024, 5:40 PMmbonnin
03/29/2024, 5:40 PMmbonnin
03/29/2024, 5:41 PMStylianos Gakis
03/29/2024, 5:45 PMStylianos Gakis
03/29/2024, 5:49 PMgetByName("debug") {
signingConfig = signingConfigs.getByName("confetti")
and that the right SHA is added to the .well-known, so far even after a clean re-install of the app and after adding <intent-filter android:autoVerify="true">
The app does not seem to automatically pick up that it should handle those links.
If I go in the app settings in “Open by default” and I select the link manually the deep link seems to work though with this PR in its current state. https://github.com/joreilly/Confetti/pull/1214Stylianos Gakis
03/29/2024, 5:50 PMStylianos Gakis
03/29/2024, 6:05 PMdev.johnoreilly.confetti
package name
• Adding the right keystore with the aforementioned SHA, which we do here for the debug build which I run locally, which is specified here. I have verified this all with what Martin mentioned here, but with the debug keystoer
• Adding autoVerify here https://github.com/joreilly/Confetti/blob/ea69b1a14c3476f2fd9f3cd12e4e96639f2280fa/androidApp/src/main/AndroidManifest.xml#L78
I’ve checked in our Hedvig production/staging/dev app and we’re doing the exact same things too actually as far as I can tell.
Stylianos Gakis
03/29/2024, 6:07 PMmbonnin
03/29/2024, 6:09 PMadb shell dumpsys
something?mbonnin
03/29/2024, 6:17 PMmbonnin
03/29/2024, 6:17 PMStylianos Gakis
03/29/2024, 6:21 PMapplication/octet-stream
instead of application/json
?
Is this a problem with how GitHub is serving this page? Because GitHub pages are used for this afaiu right?
It is true btw that when I try to go to the URL for our app, I get the JSON in Chrome and I see the json content there. When I try to do the same with the Confetti url chrome automatically downloads the file instead.
edit: And yup, the response for https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://hedvigdevelop.page.link for example looks fine in comparison.mbonnin
03/29/2024, 6:23 PMmbonnin
03/29/2024, 6:23 PMmbonnin
03/29/2024, 6:24 PMStylianos Gakis
03/29/2024, 6:24 PMmbonnin
03/29/2024, 6:25 PMmbonnin
03/29/2024, 6:26 PMStylianos Gakis
03/29/2024, 6:51 PMJohn O'Reilly
03/29/2024, 6:54 PMmbonnin
03/29/2024, 6:54 PMwhat documentation did you go through?There's a doc here but I mainly copy/pasted an example I found somewhere and already lost 😄
mbonnin
03/29/2024, 6:55 PMStylianos Gakis
03/29/2024, 6:59 PMmbonnin
03/29/2024, 7:07 PMStylianos Gakis
03/29/2024, 7:16 PMmbonnin
03/29/2024, 7:20 PMStylianos Gakis
03/29/2024, 7:20 PMmbonnin
03/29/2024, 7:22 PMOh no! This page does not exist or is not supported on the web 😞
Want to help build awesome Kotlin apps? Join us at [link to Github issue]
Just want to see the schedule? Download our [android] and [ios] apps.
Stylianos Gakis
03/29/2024, 7:22 PMmbonnin
03/29/2024, 7:23 PMJohn O'Reilly
03/29/2024, 7:39 PMmbonnin
03/29/2024, 7:41 PMmbonnin
03/29/2024, 7:42 PMJohn O'Reilly
03/29/2024, 7:43 PMmbonnin
03/29/2024, 7:43 PMmbonnin
03/29/2024, 7:44 PMStylianos Gakis
03/29/2024, 10:22 PMStylianos Gakis
03/29/2024, 10:26 PMmbonnin
03/29/2024, 10:38 PMStylianos Gakis
03/29/2024, 10:41 PMArkadii Ivanov
03/29/2024, 11:10 PMif there will be a problem if there is a deep link which we try to handle while Decompose will at the same time try to restore a previously known state after a process death perhaps?This part is explicitly covered in the docs: https://arkivanov.github.io/Decompose/navigation/stack/deeplinking/ I recommend updating Decompose to the latest 3.x alpha, as that "state restoration" problem was already addressed. In this case you can just follow the "Handling deep links since v3.0.0-alpha01" section.
Arkadii Ivanov
03/29/2024, 11:11 PMStylianos Gakis
03/29/2024, 11:16 PMArkadii Ivanov
03/29/2024, 11:21 PMStylianos Gakis
03/29/2024, 11:22 PMArkadii Ivanov
03/29/2024, 11:23 PMStylianos Gakis
03/29/2024, 11:23 PMStylianos Gakis
03/30/2024, 1:22 AMJohn O'Reilly
03/30/2024, 7:13 AMArkadii Ivanov
04/06/2024, 2:18 PMStylianos Gakis
04/06/2024, 3:16 PMArkadii Ivanov
04/06/2024, 3:16 PMStylianos Gakis
04/06/2024, 3:16 PMStylianos Gakis
04/06/2024, 3:17 PMArkadii Ivanov
04/06/2024, 7:51 PMStylianos Gakis
04/07/2024, 1:43 PMArkadii Ivanov
04/07/2024, 1:48 PMStylianos Gakis
04/07/2024, 1:49 PMJohn O'Reilly
04/07/2024, 3:02 PMJohn O'Reilly
04/07/2024, 3:02 PMStylianos Gakis
04/07/2024, 5:41 PMif (initialItemId != null) {
intent = Intent(intent).setData(null) // The deep link has been handled, clear the Intent data
}
As the docs suggest dos not seem to be enough. I think there might be something I can do by looking at the intent flags.Arkadii Ivanov
04/07/2024, 5:51 PMArkadii Ivanov
04/07/2024, 5:51 PMStylianos Gakis
04/07/2024, 5:53 PMArkadii Ivanov
04/07/2024, 5:54 PMArkadii Ivanov
04/07/2024, 5:54 PMStylianos Gakis
04/07/2024, 5:55 PMStylianos Gakis
04/07/2024, 5:55 PMMaybe just call intent.setData(null)?WIll try this too
Stylianos Gakis
04/07/2024, 5:58 PMintent.setData(null)
.
And at that same “after process death” scenario, this
Log.d("Stelios", "Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY was ${intent.flags and Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY}")
prints “Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY was 0”, so I do not get that flag either to help me distinguish this scenarioArkadii Ivanov
04/07/2024, 6:01 PMStylianos Gakis
04/07/2024, 6:01 PMArkadii Ivanov
04/07/2024, 6:02 PMStylianos Gakis
04/07/2024, 6:02 PMArkadii Ivanov
04/07/2024, 6:02 PMArkadii Ivanov
04/07/2024, 6:03 PMArkadii Ivanov
04/07/2024, 6:04 PMStylianos Gakis
04/07/2024, 6:05 PMStylianos Gakis
04/07/2024, 6:06 PMIntent.FLAG_ACTIVITY_NEW_TASK was 268435456
Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY was 0
initialConferenceId:null
Then kill the app from recents.
Then open the app through a deep link:
Intent.FLAG_ACTIVITY_NEW_TASK was 268435456
Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY was 0
initialConferenceId:androidmakers2024
Then go to some other conference in the app, like SHEDEV Warsaw.
Then go to home
Then kill the process in AS
Then open the app from recents:
Intent.FLAG_ACTIVITY_NEW_TASK was 268435456
Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY was 0
initialConferenceId:androidmakers2024
Stylianos Gakis
04/07/2024, 6:07 PMArkadii Ivanov
04/07/2024, 6:16 PMStylianos Gakis
04/07/2024, 6:42 PMArkadii Ivanov
04/07/2024, 6:42 PMStylianos Gakis
04/07/2024, 7:05 PMremember { mutableStateOf(whatever here) }
. So I could not put the AppComponent in a way to make it observable so that when it changes the whole app will “recompose” so that it will use the new AppComponent which I am setting when the deep link comes.
Instead I did this hack where I trigger the “recomposition” with something that can in fact be observer, so then the new AppComponent
is picked up.
I would really appreciate some help here from someone with more SwiftUI experience on how to not make this big hackJohn O'Reilly
04/07/2024, 7:09 PMJohn O'Reilly
04/07/2024, 7:14 PMJohn O'Reilly
04/07/2024, 7:16 PMStylianos Gakis
04/07/2024, 7:16 PMArkadii Ivanov
04/07/2024, 7:21 PMArkadii Ivanov
04/07/2024, 7:26 PMArkadii Ivanov
04/07/2024, 7:27 PMArkadii Ivanov
04/07/2024, 7:28 PMStylianos Gakis
04/07/2024, 7:42 PMArkadii Ivanov
04/07/2024, 7:44 PMStylianos Gakis
04/07/2024, 7:47 PMJohn O'Reilly
04/08/2024, 2:43 PMArkadii Ivanov
04/08/2024, 2:45 PMArkadii Ivanov
04/08/2024, 4:17 PMStylianos Gakis
04/08/2024, 4:29 PMStylianos Gakis
04/08/2024, 4:30 PMArkadii Ivanov
04/08/2024, 4:38 PMArkadii Ivanov
04/08/2024, 4:38 PMStylianos Gakis
04/08/2024, 4:54 PMStylianos Gakis
04/08/2024, 5:15 PMArkadii Ivanov
04/08/2024, 5:34 PMand you’ll notice instead of going back to Twitter as you should, you go back to whatever other screen you were inWhat exactly do you mean by "other screen"? Maybe you could share a video?
Arkadii Ivanov
04/08/2024, 5:36 PMArkadii Ivanov
04/08/2024, 5:37 PMArkadii Ivanov
04/08/2024, 5:40 PMStylianos Gakis
04/08/2024, 5:40 PMStylianos Gakis
04/08/2024, 5:41 PMMaybe this is the way how that app handles the case? https://github.com/HedvigInsurance/android/blob/a72279543f5811216b539ff0844ff7db2ae4133e/app/app/src/main/kotlin/com/hedvig/app/feature/loggedin/ui/LoggedInActivity.kt#L280
No that one is only used for the login flow, it's a leftover from never picking up the work to bring the login flow into one activity. This is never called in deep link handling
Arkadii Ivanov
04/08/2024, 5:43 PMStylianos Gakis
04/08/2024, 5:48 PMStylianos Gakis
04/08/2024, 5:50 PMArkadii Ivanov
04/08/2024, 5:50 PMArkadii Ivanov
04/08/2024, 5:56 PMStylianos Gakis
04/08/2024, 6:08 PMIntent.FLAG_ACTIVITY_NEW_TASK
Intent.FLAG_ACTIVITY_CLEAR_TASK
And then we can be more sure about it. Give me a bit of time and I'll be back on the computer to check this outArkadii Ivanov
04/08/2024, 6:18 PMflags and Intent.FLAG_ACTIVITY_NEW_TASK != 0 &&
flags and Intent.FLAG_ACTIVITY_CLEAR_TASK == 0
Arkadii Ivanov
04/08/2024, 7:03 PMStylianos Gakis
04/08/2024, 7:17 PMStylianos Gakis
04/14/2024, 4:23 PMArkadii Ivanov
04/14/2024, 6:05 PMJohn O'Reilly
04/14/2024, 6:17 PMJohn O'Reilly
04/14/2024, 6:18 PMJohn O'Reilly
04/14/2024, 6:20 PMStylianos Gakis
04/14/2024, 6:20 PMObservableObject
too and no re-render hacks like before!
Arkadii could you take a look at those too perhaps? I tried to look into this commit https://github.com/arkivanov/Essenty/commit/19072367b9fd4cde486ed7133f244ff7db6f27ba to check if I am using the .destroy()
API correctly, but I can’t say I am 100% confident with it without an OK from your side tooStylianos Gakis
04/14/2024, 6:20 PMArkadii Ivanov
04/14/2024, 6:42 PMStylianos Gakis
04/14/2024, 6:45 PMArkadii Ivanov
04/14/2024, 9:56 PMStylianos Gakis
04/15/2024, 10:05 PMJohn O'Reilly
04/16/2024, 6:33 AMJohn O'Reilly
04/16/2024, 6:34 AMJohn O'Reilly
04/16/2024, 6:35 AMJohn O'Reilly
04/16/2024, 11:41 AMJohn O'Reilly
04/16/2024, 11:48 AMStylianos Gakis
04/16/2024, 1:44 PMStylianos Gakis
04/16/2024, 1:59 PMmbonnin
04/16/2024, 2:02 PMStylianos Gakis
04/16/2024, 2:05 PMStylianos Gakis
04/16/2024, 2:05 PMArkadii Ivanov
04/20/2024, 4:12 PMwithDeepLink
function, which in theory could be moved to Decompose. Wondering what's your opinion on this approach?Arkadii Ivanov
04/23/2024, 8:07 PMStylianos Gakis
04/23/2024, 9:00 PMArkadii Ivanov
04/23/2024, 9:48 PMStylianos Gakis
04/26/2024, 8:41 AMsavedStateRegistry
, it was interesting. I had some comments around there, some out of curiosity and one because I was not sure I was following the new flow properly, so I am not 100% sure if it’s a real problem or if I am misunderstanding it.
But all in all this is looking great, perhaps it is also going to make moving these functions to the decompose docs much easier. And leave the clients then do the extractConferenceIdOrNull
part themselves, for whatever deep links they got.Arkadii Ivanov
04/26/2024, 11:43 AMwithDeepLink
function to Decompose, and I'm going to release the new version soon. We could then update Confetti as well and see how it works. I've checked it manually already, seems to work fine, but I might be missing some corner cases.
See: https://github.com/arkivanov/Decompose/pull/701Arkadii Ivanov
04/26/2024, 2:12 PMArkadii Ivanov
04/26/2024, 2:14 PMStylianos Gakis
04/26/2024, 2:15 PMArkadii Ivanov
04/26/2024, 2:19 PMArkadii Ivanov
04/26/2024, 3:07 PMStylianos Gakis
04/26/2024, 3:12 PMArkadii Ivanov
04/26/2024, 3:15 PMStylianos Gakis
04/26/2024, 3:16 PMArkadii Ivanov
04/26/2024, 3:20 PMStylianos Gakis
04/26/2024, 3:36 PMArkadii Ivanov
04/26/2024, 3:49 PMArkadii Ivanov
04/26/2024, 3:49 PMStylianos Gakis
04/26/2024, 3:56 PMArkadii Ivanov
04/26/2024, 4:00 PMArkadii Ivanov
04/26/2024, 4:00 PMArkadii Ivanov
04/29/2024, 9:55 PM