https://kotlinlang.org logo
#android-architecture
Title
# android-architecture
u

ursus

08/25/2020, 12:25 AM
Has anybody by change got app links working with custom url scheme? (The feature which identifies a link as "yours" and will not show a disambiguation dialog) -- but doesnt seem to work with custom schemes
g

gildor

08/25/2020, 5:49 AM
app links?
feature where you can register a given url as your own, as not to show the disambiguation dialog .. say only fficial twitter app opening www.twiter.com/.. urls
g

gildor

08/26/2020, 12:17 AM
But you don't need it for custom scheme, isn't it? Just define handling for custom scheme, and you will be the only app which can handle it
App Links need only for web urls, to avoid opening in the browser
u

ursus

08/26/2020, 1:35 PM
Well nobody is forbiding some 3rd party app to use my custom scheme as well, can it?
g

gildor

08/26/2020, 1:48 PM
Yep, but does it really important? It's pretty clear why custom protocol is not supported, because it wouldn't be possible to validate your link, you can claim that some web domain belongs to you, and you validate it using a special file on this domain, but what about your custom protocol? Hi how would it be possible for the system proof that it's your domain on this protocol, imagine someone would claim that onion://google.com belongs to you, how would system validate it? There is no way to support all possible protocols What kind use case you have for it exactly? Or it's just theoretical
u

ursus

08/26/2020, 2:04 PM
Yes it makes sense its impossible, Im just looking around. My issue is actually internal, login is via browser oauth, and have flavored apps depending on backend enviroment, and the redirectUri is same for all flavors so disambiguation dialog kicks in
b

brandonmcansh

08/26/2020, 2:34 PM
Can you intercept the redirect before handling it? Set the package on the intent for the URI launch
Other option is make your URI prefix more unique to the flavor but let your white label app still handle a wildcard
someprefix-*://
g

gildor

08/26/2020, 2:55 PM
You should use different path return url for every flavor, oauth allows to specify any custom redirect url Usage of your app id is unique enough
u

ursus

08/26/2020, 5:24 PM
yes that makes most sense, thanks
3 Views