Back to Cordova

2021 09 11

slack-digest/2021-09-11.md

latest6.4 KB
Original Source

Cordova Slack Digest

Sat, 11 Sep 2021 08:20:52 GMT

User count: 4616

Join the conversation at slack.cordova.io

Channel #general (44 messages)


Fri, 10 Sep 2021 12:47:45 GMT

@cashamir says

So I just created a new project in Cordova, anyone that can tell me why the device ready event works on localhost (browser platform) but not when i transfer the files from the "www" folder into a subfolder on my domain

Fri, 10 Sep 2021 12:47:51 GMT

@cashamir says

What am I missing ?

Fri, 10 Sep 2021 12:48:53 GMT

@cashamir says

Meanwhile waiting, I'll keep reading the docs

Fri, 10 Sep 2021 12:50:26 GMT

@norman137 says

are you loading in the cordova.js file?

Fri, 10 Sep 2021 12:51:09 GMT

@cashamir says

I tried yes, i created the file in the root folder once i saw it was missing

Fri, 10 Sep 2021 12:51:23 GMT

@cashamir says

and made a simple alert from it

Fri, 10 Sep 2021 12:51:43 GMT

@cashamir says

that runs on the domain, but not on local

Fri, 10 Sep 2021 12:51:57 GMT

@cashamir says

the exact opposite

Fri, 10 Sep 2021 12:53:46 GMT

@cashamir says

So the domain looks like this

Fri, 10 Sep 2021 12:53:55 GMT

@cashamir says

Fri, 10 Sep 2021 12:54:15 GMT

@cashamir says

Fri, 10 Sep 2021 12:55:52 GMT

@cashamir says

and localhost doesn't trigger the "hello from cordova" alert but it does say "device is ready"

Fri, 10 Sep 2021 12:55:56 GMT

@cashamir says

Fri, 10 Sep 2021 12:56:22 GMT

@cashamir says

Tried to google, but not that much info

Fri, 10 Sep 2021 12:56:45 GMT

@cashamir says

Glad i found this community, at least I can communicate with someone, the old stackoverflow posts doesn't help much

Fri, 10 Sep 2021 13:44:21 GMT

@cashamir says

might be an access request problem

Fri, 10 Sep 2021 13:44:23 GMT

@cashamir says

https://cordova.apache.org/docs/en/10.x/guide/appdev/allowlist/index.html#network-request-allow-list

Fri, 10 Sep 2021 13:50:31 GMT

@norman137 says

Yah I don't really pay that much attention to stackoverflow personally myself

Fri, 10 Sep 2021 13:51:43 GMT

@norman137 says

I'm not that familiar with the browser platform and it is quite a bit different than the other "native" platforms, but a deviceready event is suppose to fire once all plugins are initialized.

Fri, 10 Sep 2021 14:02:13 GMT

@norman137 says

Just did a quick test and it appears to be working for me (on a simple template app with no plugins except for whitelist plugin)

Fri, 10 Sep 2021 14:02:48 GMT

@norman137 says

the alert is blocking, but once I dismiss the dialog I see Device is Ready

Fri, 10 Sep 2021 14:05:37 GMT

@norman137 says

> I tried yes, i created the file in the root folder once i saw it was missing This is confusing me, you don't create a cordova.js file, it's supplied to you. The file would be located in <cordova-project>/platforms/browser/www, which is where your source code is copied to when you build/run the "browser" platform.

Fri, 10 Sep 2021 14:14:37 GMT

@erisu says

Just for a side note: As far as I am aware, the deprecated cordova-plugin-whitelist plugin does not support the browser platform. Installing it or setting AllowList configs would not make a difference. The plugin it self only added functionality to Android. iOS had it integrated in core. And Android, as of 10.x, has it integrated and relabeled as AllowList.

Fri, 10 Sep 2021 14:21:47 GMT

@erisu says

I am also not really sure about the status of browser. Its last release was early 2019, over 2 years ago, and probably was not a big release. The one before that was 2017...

Fri, 10 Sep 2021 14:22:34 GMT

@cashamir says

@norman137 my problem is not localhost, that works for me as well

Fri, 10 Sep 2021 14:22:49 GMT

@cashamir says

my problem is when i run it on my domain

Fri, 10 Sep 2021 14:24:02 GMT

@cashamir says

@erisu Thank you for the side note, I'm not really sure about that to be honest. The main reason i started looking at Cordova, was that i need the ability to control the keyboard on phone devices.

Fri, 10 Sep 2021 14:24:35 GMT

@cashamir says

My app i made with vanilla JS

Fri, 10 Sep 2021 14:26:15 GMT

@cashamir says

I'm running the app from a browser inside the phone, so I'm not really sure that is the right tool for the right problem, to be honest with you

Fri, 10 Sep 2021 14:28:04 GMT

@cashamir says

Also Audio API bugs on Iphone devices, which was my next reason 🙂

Fri, 10 Sep 2021 14:30:53 GMT

@erisu says

So are you planning to deploy your web app only to your web server? and people access it though the mobile device's browser?

Fri, 10 Sep 2021 14:32:52 GMT

@cashamir says

@erisu yes, which i know sound stupid, but the app works perfectly on desktop/browsers

Fri, 10 Sep 2021 14:33:06 GMT

@cashamir says

I have problems with Android and IOS

Fri, 10 Sep 2021 14:33:57 GMT

@cashamir says

if you like I can share the app with you in private and maybe you could help me figure out if Cordova is the right solution for me

Fri, 10 Sep 2021 14:35:09 GMT

@erisu says

If deploying to a web server and expecting users to access though a browser mobile or desktop, you will be limit you to only what is available with web APIs and what ever that browser supports..

Fri, 10 Sep 2021 14:39:06 GMT

@cashamir says

Yeah I see what you mean, my other problem is, I don't have a mac for IOS

Fri, 10 Sep 2021 14:40:06 GMT

@cashamir says

And as i heard, VM wont work for that

Fri, 10 Sep 2021 14:40:38 GMT

@cashamir says

Do to Apple not supporting USB access

Fri, 10 Sep 2021 14:41:29 GMT

@cashamir says

Do you have a Iphone @erisu?

Fri, 10 Sep 2021 14:42:25 GMT

@erisu says

Yeah

Fri, 10 Sep 2021 14:42:38 GMT

@cashamir says

If it's okay with you, I can send you a link to the app for you to see how it's bugging on IOS

Fri, 10 Sep 2021 14:43:02 GMT

@cashamir says

in PM

Fri, 10 Sep 2021 15:15:44 GMT

@cashamir says

Wait a second, how come the example here use onload in the HTML ?

Fri, 10 Sep 2021 15:15:48 GMT

@cashamir says

https://cordova.apache.org/docs/en/10.x/cordova/events/events.html#deviceready