Android app running as homescreen launcher + OAuth flow launches second instance #4210
Unanswered
mattdsteele
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks! 👋
Has anyone built an app that run as a homescreen launcher (e.g. it has the
android.intent.category.HOME
category), and which also can be launched via a custom URL scheme (e.g. com.foo.bar://)? I am having a hard time getting the two to play with each other.For context, I'm trying to build a secured launcher that authenticates a user via an OAuth server, using Chrome Custom Tabs. Its redirect URI is a custom scheme which points back to the app. I can authenticate fine, but when it redirects, a second instance of my app gets started, and my original "launcher" instance moves to the background.
I've tried all sorts of combinations setting
taskMode
tosingleInstance
,singleTop
, and lots of other combinations, and tried settings flags on theCustomTabsIntent
but I've made no progress, an am beginning to think that I can't square that circle.As a workaround, my current plan is to authenticate by launching a second app, which will perform the OAuth flow, and then immediately exit, returning the user back to the launcher. It's ugly, but I know I can retain only one instance of the app running this way. I'm really hoping there's a better way though!
Beta Was this translation helpful? Give feedback.
All reactions