Deep linking in Compose Single Activity Architecture

83 Views Asked by At

Usecase: Single activity Compose app handling Firebase Auth magic email link.

Problem: if app is already opened and the user clicks the link, a new task is created and there are two instances of the app in the Recents screen. I understand this is the default behaviour of the standard launchMode but I think it's confusing the average user and it doesn't make sense in login where the other task most likely contains just a Welcome screen.

Proposed solution: change launchMode of single activity to singleTask and call navController.handleDeepLink() in onNewIntent.

However, this solution goes against Google's recommendation to "always use the default launchMode of standard when using Navigation."

What is the best practice here?

0

There are 0 best solutions below