Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Capacitor 4 support #14226

Merged
merged 2 commits into from
May 8, 2023
Merged

Conversation

jcesarmobile
Copy link
Contributor

What kind of change does this PR introduce?

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

Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • 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)

@rstoenescu rstoenescu self-requested a review August 22, 2022 15:18
@rstoenescu
Copy link
Member

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).

@eranshmil
Copy link

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.

@eqoram
Copy link

eqoram commented Nov 9, 2022

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

@DouglasCalora
Copy link

Updates??

@felipejuzo02
Copy link

Any updates???

@gcarpi
Copy link

gcarpi commented Mar 21, 2023

Updates?

@Larry-Home
Copy link

@rstoenescu Can we get this merged in?

@eqoram
Copy link

eqoram commented Mar 27, 2023

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. :)

@IlCallo
Copy link
Member

IlCallo commented Mar 27, 2023

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
Copy link
Member

IlCallo commented Mar 29, 2023

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...

@HiPhone-Chan
Copy link

Any updates? Capacitor is in v5 now.

@Larry-Home
Copy link

@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!

@cerw
Copy link

cerw commented Mar 30, 2023

Thanks @Larry-Home @IlCallo , appraciate your work

@eqoram
Copy link

eqoram commented May 6, 2023

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)

@rstoenescu rstoenescu merged commit 6505221 into quasarframework:dev May 8, 2023
rstoenescu added a commit that referenced this pull request May 8, 2023
@rstoenescu
Copy link
Member

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

@rstoenescu
Copy link
Member

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

@Larry-Home
Copy link

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

@rstoenescu
Copy link
Member

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

@jcesarmobile jcesarmobile deleted the capacitor-4 branch May 8, 2023 14:07
@jcesarmobile
Copy link
Contributor Author

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)

@IlCallo
Copy link
Member

IlCallo commented May 8, 2023

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

@rstoenescu
Copy link
Member

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

@eqoram
Copy link

eqoram commented May 9, 2023

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

@rstoenescu
Copy link
Member

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.

@eranshmil
Copy link

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

@IlCallo
Copy link
Member

IlCallo commented Sep 4, 2023

We fixed the Capacitor 5 error some months ago IIRC

@ctrengove
Copy link

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.

@rstoenescu
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.