quasar icon indicating copy to clipboard operation
quasar copied to clipboard

feat: Add Capacitor 4 support

Open jcesarmobile opened this issue 3 years ago • 1 comments

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] Feature
  • [ ] Documentation
  • [ ] Code style update
  • [ ] Refactor
  • [ ] Build-related changes
  • [ ] Other, please describe:

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

The PR fulfills these requirements:

  • [x] It's submitted to the dev branch (or v[X] branch)
  • [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • [ ] It's been tested on a Cordova (iOS, Android) app
  • [ ] It's been tested on an Electron app
  • [ ] Any necessary documentation has been added or updated in the docs or explained in the PR's description.

If adding a new feature, the PR's description includes:

  • [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to start a new feature discussion first and wait for approval before working on it)

Other information:

Remove the -beta.0 from the platform version installed update the template to use ^4.0.0 for capacitor packages patch MainActivity to add EnableHttpsSelfSigned on Capacitor 4

Disclaimer: Only tested for vite, for webpack I pasted the changes Didn't patch self signed certificates for iOS as it was not working on Capacitor 2 neither (I just get an "infinite loop" of server connection lost. polling for restart... messages on Xcode console)

jcesarmobile avatar Aug 19 '22 18:08 jcesarmobile

Thanks for contributing! You'll have to wait a bit until I merge this. Will go into q/app-vite v1.2 (probably next week).

rstoenescu avatar Sep 16 '22 17:09 rstoenescu

Hi @jcesarmobile, I upgraded my project to capacitor 4 and tried using the same solution but now it breaks all of the plugins. (Plugin Not Implemented error)

The only solution that worked is using your plugin @jcesarmobile/ssl-skip.

eranshmil avatar Oct 19 '22 07:10 eranshmil

Any updates on this? Would be nice to import Plugins for Capacitor the new way like in v3 and v4 :)

eqoram avatar Nov 09 '22 21:11 eqoram

Updates??

DouglasCalora avatar Mar 21 '23 14:03 DouglasCalora

Any updates???

felipejuzo02 avatar Mar 21 '23 14:03 felipejuzo02

Updates?

gcarpi avatar Mar 21 '23 14:03 gcarpi

@rstoenescu Can we get this merged in?

Larry-Home avatar Mar 26 '23 00:03 Larry-Home

It seems that there are still a couple of blockers regarding this PR. You can see in the roadmap (https://github.com/quasarframework/quasar/blob/dev/ROADMAP.md) that supporting Capacitor 4 is planned for Q2. :)

eqoram avatar Mar 27 '23 09:03 eqoram

We took a look a while back but there are many things which needs to be tested and adapted before merging this in, so it'll still have to wait a bit before we can provide it the love it deserves, at least after we complete the CJS >> ESM migration for many Quasar packages and the release of new docs

IlCallo avatar Mar 27 '23 16:03 IlCallo

I literally provided an update 2 days ago and it's listed into the ROADMAP to be implemented by Q2 of this year since last month...

IlCallo avatar Mar 29 '23 08:03 IlCallo

Any updates? Capacitor is in v5 now.

HiPhone-Chan avatar Mar 30 '23 04:03 HiPhone-Chan

@HiPhone-Chan & all - PLEASE read the prior posts before responding! Literally the post above the last was an update message and 2 more before that ANOTHER update message! Certainly not doing any good taking focus away from product development to answer the same question repeatedly.

As for v5 it is alpha and certainly not anything that needs to be considered in this request!

Larry-Home avatar Mar 30 '23 11:03 Larry-Home

Thanks @Larry-Home @IlCallo , appraciate your work

cerw avatar Mar 30 '23 11:03 cerw

FYI Capacitor v5 was released a couple of days ago and it seems to be an important upgrade as older versions of capacitor might not work anymore on newer devices (https://ionic.io/blog/announcing-capacitor-5)

eqoram avatar May 06 '23 13:05 eqoram

Thanks for contributing! It seems that there is an officially advertised way to go with SSL dev support. Implemented it.

rstoenescu avatar May 08 '23 13:05 rstoenescu

This will go into q/app-vite 1.4.0 and q/app-webpack 3.9.0

rstoenescu avatar May 08 '23 13:05 rstoenescu

Appreciate the efforts to get this moving forward and communication on the status. Thanks!

Larry-Home avatar May 08 '23 13:05 Larry-Home

If anyone to thank to, it's @jcesarmobile for his package (@jcesarmobile/ssl-skip) which became the official way of doing it.

rstoenescu avatar May 08 '23 14:05 rstoenescu

I wouldn't consider @jcesarmobile/ssl-skip the official way of doing it. I haven't had the chance to look at the code that adds the plugin, but you should remove the plugin for release builds as it can cause app rejections in the stores (maybe it already does it, as I said, didn't look at the code yet)

jcesarmobile avatar May 08 '23 14:05 jcesarmobile

It's only installed when in dev mode, not for production builds

IlCallo avatar May 08 '23 14:05 IlCallo

It's recommended right on Capacitor's documentation website, so that would make it official.

rstoenescu avatar May 08 '23 15:05 rstoenescu

Do these changes also enable support for capacitor v5? :)

eqoram avatar May 09 '23 09:05 eqoram

They seem to do, but there's a catch. The only reason I haven't explicitly stated this is that the current Capacitor v5 has an Android bug (opening up the IDE will trigger an error) -- and this is by default, with nothing changed from our part. Once this is sorted out, we'll announce v5 support too. However, should you want to use it right now, you can go ahead.

rstoenescu avatar May 09 '23 10:05 rstoenescu

They seem to do, but there's a catch. The only reason I haven't explicitly stated this is that the current Capacitor v5 has an Android bug (opening up the IDE will trigger an error) -- and this is by default, with nothing changed from our part. Once this is sorted out, we'll announce v5 support too. However, should you want to use it right now, you can go ahead.

I'm using Capacitor v5 and I'm not getting an error when running the following command:

quasar dev -m capacitor -T android

eranshmil avatar Sep 04 '23 09:09 eranshmil

We fixed the Capacitor 5 error some months ago IIRC

IlCallo avatar Sep 04 '23 09:09 IlCallo

The plugin is only installed when in dev mode, but I believe that then switching to build mode doesn't cause the file EnableHttpsSelfSigned.java to be removed if it is already there. This ends up causing a Security and Trust issue in the Play Store. It is easy to fix (just delete the file and re-build), but it would be nice to have the file removed automatically, or at least have the issue documented somewhere.

ctrengove avatar Mar 03 '24 01:03 ctrengove

@ctrengove But it is automatically removed. Please make sure that you have the latest q/app-vite or q/app-webpack

rstoenescu avatar Mar 04 '24 08:03 rstoenescu