GitHub App Installation flow on mobile+web (multi platform)? #24468
-
I’m preparing to submit the app to the Marketplace. The app has three versions: Web, Electron and Mobile. Since setting up the “Setup URL” is required by Marketplace, I made it redirect to the root url (myappname.com?installation_id=123). It works fine. But how about on mobile? How do I make it redirect to a different URL or something like that? Because it shouldn’t redirect to myappname.com web version, it should trigger the What I suggest is something similar to the oauth flow: If I could pass a query variable like “state” to the installation url (e.g. github.com/apps/app-name/installations/new/permissions?target_id=123 &state=MYSTATEHERE &maybeothervar=123) and GitHub included this query variable when redirecting to the Setup URL (myappname.com/setup-url ?state=MYSTATEHERE ) then I would be able to handle it. But since this isn’t possible, any suggestion? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I’ve just come up with a hacky solution:
|
Beta Was this translation helpful? Give feedback.
I’ve just come up with a hacky solution:
Instead of redirecting directly from the app to github, redirect to myserver.com/install/app?platform=mobile instead.
This endpoint will save the app type (web/electron/mobile) as a cookie or localstorage.
Redirects to github and install the app
GitHub redirects to another endpoint of mine: myserver.com/install/app/callback?installation_id=123
This endpoint will check the cookie/localstorage, so now it knows the platform and what to do next. E.g. if mobile, redirect to myappscheme://.