dorche
12/29/2022, 1:05 PMdorche
12/29/2022, 1:08 PMdorche
12/29/2022, 1:21 PM<myAppScheme://test.something.co.uk/payment?id=aaaaaaaa-cccc-dddd-eeee-bbbbbbbbbbb8&status=success>
From there we have two options that we’d be happy with:
• User is returned to the screen they last were in-app (before launching the custom tab) and we have access to the id
and status
from above so we potentially navigate away or do some validation
• User is navigated to “Result” screen that naturally follows the screen that started the web journey. Similarly to above we’d need access to id
and status
Is my only good option to introduce that wrapper activity so my MainActivity stays intact or am I missing something here and there’s a Compose way to achieve this?dorche
12/29/2022, 1:42 PMdeepLink
with a matching uriPattern
then the problem is that this starts a “fresh” activity with no backstack which is then awkward for the user.dorche
12/29/2022, 2:09 PMandroid:launchMode
of my MainActivity to anything other than standard
I lose the automatic navigation mentioned in the reply just above but at least I am back in my original activity and the original composable that launched the web journey.
I assume that from here, I’d have to override onNewIntent
in my Activity and manually extract the meaningful data.
What would be the best way to bridge that manually parsed data back to my Composable screens? I could extract the data in onNewIntent
in my Activity, pass it up to a ActivityViewModel
which could then pass that to DeepLinkRepository
. From there I could expose the data via a StateFlow that can then be consumed by my actual Composable via it’s own ViewModel, and trigger a navigation event forward to “Result” composable whenever that data is available/collected.
Besides the fact I need to be careful with launchMode
because of Task Hijacking I think the above approach might actually work.
Wondering if anyone has already done something similar? Is there a potential issue that I’m not seeing yet and I’m just going down a rabbit hole?