Back to Cordova

2021 02 13

slack-digest/2021-02-13.md

latest3.6 KB
Original Source

Cordova Slack Digest

Sat, 13 Feb 2021 08:33:38 GMT

User count: 4367

Join the conversation at slack.cordova.io

Channel #general (1 messages)


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!

Channel #cordova-android (7 messages)


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.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 to singleInstance, singleTop, and lots of other combinations, and tried settings flags on the CustomTabsIntent 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!

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 singleTask or singleInstance as 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. singleInstance for 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-oauth to 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-oauth but 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 as singleTask or singleInstance), or it leaves the Custom Tab window in ths task switcher (if I'm using singleActivity).

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