slack-digest/2021-02-13.md
Sat, 13 Feb 2021 08:33:38 GMT
Join the conversation at slack.cordova.io
Fri, 12 Feb 2021 10:17:45 GMT
@garycuetara says
Hello! I am new to cordova development and I am working on a windos + android app that I need to be able to compile and publish to s3 in order to use electron-builder autoupload. I have made a stack-overflow post since I seem to not be able to do as needed: https://stackoverflow.com/questions/66157182/cordova-electron-publish-to-s3 I don't know if anyone knows any way to do it. Thanks!
Fri, 12 Feb 2021 20:28:30 GMT
@mattdsteele says
Hi all! 👋
Has anyone built a Cordova app that run as a homescreen launcher (e.g. it has the
android.intent.category.HOMEcategory), 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
taskModetosingleInstance,singleTop, and lots of other combinations, and tried settings flags on theCustomTabsIntentbut 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!
Fri, 12 Feb 2021 20:38:25 GMT
@norman137 says
Interesting problem, not something I've done before, but based on https://developer.android.com/guide/topics/manifest/activity-element#lmode it sounds like you either want
singleTaskorsingleInstanceas a launch mode
Fri, 12 Feb 2021 20:40:54 GMT
@dpogue says
I wonder if because it's running as a launcher, there's no concept of a "task" for it
Fri, 12 Feb 2021 20:41:29 GMT
@mattdsteele says
Yup; I've tried both, but neither works quite how I want.
singleInstancefor example, the Custom Tab "breaks out" of the launcher activity, and ends up sticking around in the Task Switcher, which we don't want
Fri, 12 Feb 2021 20:42:57 GMT
@mattdsteele says
@dpogue Yeah I'm not sure! Currently I'm cobbling things together using a variety of plugins (essentially following the pattern in https://firebase.google.com/docs/auth/web/cordova) but I'm also going to try using
cordova-plugin-oauthto see if it's an implementation issue)
Fri, 12 Feb 2021 20:43:47 GMT
@dpogue says
Feel free to ping me if you run into issues with cordova-plugin-oauth 😉
Fri, 12 Feb 2021 22:28:02 GMT
@mattdsteele says
@dpogue Tried switching to
cordova-plugin-oauthbut unfortunately I ran into the same issue 😕 Once my app is setup as an Android launcher, the auth redirect initializes a new instance my my app (if I'm setup assingleTaskorsingleInstance), or it leaves the Custom Tab window in ths task switcher (if I'm usingsingleActivity).I could package up the example app if you wanted to check it out, but I know this isn't really your problem to solve