-
Notifications
You must be signed in to change notification settings - Fork 57
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
Documentation - plugins #2
Comments
This repository contains a Cordova platform that has an Electron app as the output of the build process vs. a fully native app (that contains the web app). I don't think this helps with your problem at all, or did I misunderstand? |
Well this can be used in a way to solve my problem. Will it be able to use Cordova plugin( which I use for Cordova electron now Cordova-print-plugin)? |
@mavericksthinker = @bishal1994?
What do you refer to by @purplecabbage? Time to provide some context here and/or in the README maybe? |
Yes sorry , you got it right that's what I meant . I will go through the
commit history too . But a readme with some description will be very
helpful not just for me but for others to use it too as I saw
Cordova-Electron was recommended for same aim that I want to achieve. Thank
you for your attention . Hope this repo can be managed and we'll documented
to benefit everyone.
…On Thu, Nov 15, 2018, 6:44 PM Jan Piotrowski ***@***.*** wrote:
@mavericksthinker <https://github.com/mavericksthinker> = @bishal1994
<https://github.com/bishal1994>?
Will it be able to use Cordova plugin( which I use for Cordova electron
now Cordova-print-plugin)?
What do you refer to by it? If you mean a project created with Cordova
that uses the cordova-electron platform, then it depends if the plugin
implements bindings for the cordova-electron platform. I am also not sure
if the plugin system is implemented here - see the commit history for some
context how barebones this thing is currently.
@purplecabbage <https://github.com/purplecabbage>? Time to provide some
context here and/or in the README maybe?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AqM6Juv5vWPbrfNGv57_lEhJiisZnYtnks5uvVOVgaJpZM4YP0_5>
.
|
No documentation needed here to figure out if your plugin works with |
As you mentioned this will provide an electron app as output right? Does
the Cordova platform that gives electron app as output utilizes nodeJs if
yes? There must be possibilities to make plugin for the same
platform(electron app) as we do for Android and iOS .... in Cordova. That's
what I want to utilize.
…On Thu, Nov 15, 2018, 9:53 PM Jan Piotrowski ***@***.*** wrote:
No documentation needed here to figure out if your plugin works with
cordova-electron: Does it say so in the documentation? Does it have an
www/electron folder? If both is false, then it will definitely *not* work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AqM6Jvjy5efKWJdjurDvZ98c03N4yR_hks5uvX__gaJpZM4YP0_5>
.
|
That I can't tell you, sorry - no idea. |
Well that's the reason for asking documentation. Atleast the developers can
let us know what they have done .
…On Thu, Nov 15, 2018, 10:08 PM Jan Piotrowski ***@***.*** wrote:
That I can't tell you, sorry - no idea.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AqM6JkVzfH8t_UQ4LhlITdDGqny8E65wks5uvYNugaJpZM4YP0_5>
.
|
The developer that did this as an experiment is no longer on the project. From what I know, this will not support native plugins, and may or may not work with current Cordova tooling. YMMV |
(A improved implementation is in the works, I heard. No ETA though, but watch this space) |
Thank you hope to get it soon.
…On Mon, Dec 3, 2018, 4:55 PM Jan Piotrowski ***@***.*** wrote:
(A improved implementation is in the works, I heard. No ETA though, but
watch this space)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AqM6JqZmT9V8kvx8N011rJZ5CNEWUck8ks5u1PT3gaJpZM4YP0_5>
.
|
This will be able to support cordova plugins, and yes it can access nodejs methods/libraries just like any other electron app. |
* plugin's json name is unified to use browser settings in plugin.xml if there is no electron settings
i have same problem too, we want to make a new cordova, electron plugin, but i dont know how can we start and what should we do for that !
but, how we can write a plugin with electron support ? |
Now that Electron platform has been officially released, is there any more documentation on plugins that support electron (not browser)? Or anyone know of an example cordova-plugin that is supporting electron platform out there? |
We have documentation here: https://cordova.apache.org/docs/en/latest/guide/platforms/electron/index.html - if it's outdated or missing something: we really appreciate PRs! |
Hey @timbru31 , on the subject on plugins the platform documentation page essentially states "we support electron plugins" without any further information on how to create one. Over on the plugin section of the documentation https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html, there are handy guides for each platform including plugin.xml requirements for the platform and example class mappings and lifecycle information on writing plugins for that platform. Electron is sadly missing from here. I'd love to submit a PR! However before I can do that I actually need to know how to create a plugin for electron, which is why I'm searching here, the issue request for plugin documentation (and many other placings), for any clues on how to do that. If you know of any existing plugins that support electron (not browser) that you could link me to (even developer test ones), then I could hopefully figure it out backwards from there. Any help is much appreciated. |
I just updated the title. From f3de449 I can see that if a plugin works on the browser platform, it will also work on Electron. I think this should be documented better. I hope we can do this as part of the sponsored documentation project discussed in apache/cordova-docs#1057. |
@tk505 I have made a try to extend cordova-plugin-chrome-apps-sockets-udp (https://github.com/mzielezny/cordova-plugin-chrome-apps-sockets-udp) and for my usecase with electron it is working (WIP because I made only that part which let me to create broadcast over udp and receive response). |
thanks @mzielezny ! I'll have a look at it. |
Many thanks to @mzielezny, your project gave me the hints I needed to get going, most notably the syntax to use in the plugin.xml for electron. great stuff |
If anyone need I have also tried to prepare [WiP] SQLLite version of plugin - far from production but I'm using third party node module (not build as dgram) and it is working with simple cases (insert, update) |
Regarding Windows Platform Is it possible to control electrons internals like we can do on android with accessing the webView? There is a plug-in for updating the apps www content at runtime. - I know, it has a deprecation warning, but it works well - https://github.com/nordnet/cordova-hot-code-push The idea is to adopt the behaviour to the electron platform. So one has to change the location in plug-in code like they do here: https://github.com/nordnet/cordova-hot-code-push/blob/master/src/android/src/com/nordnetab/chcp/main/HotCodePushPlugin.java#L129 Related question to this is, is it possible to write to the apps www folder? Updates provided by CHCP would be downloaded there. Thanks |
I've found on the web a way to run native C++ into a pure electron app from here : https://gauriatiq.medium.com/electron-app-with-c-back-end-as-native-addon-napi-c67867f4058 Do you guys think it could be possible to leverage this to run from a plugin inside of cordova-electron somehow? |
Native node modules have to be recompiled for electron. In my sql-lite fork I'm recompiling sqllite3 module and than use it in Cordova Electron project - so I think it would be possible to work. |
Thanks for the reply, this gives me hope. |
Alright, so I managed to use compiled native C++ to run from nodejs in the context of a cordova-electron plugin! I made a starter repo demonstrating how it works. I'll now attempt to automate the process using source C++ files directly and also try to make this run on android/iOS. |
I have created a cordova plugin that works on cordova android and for electron I have a nodejs file that performs the same task as the plugin of cordova but for Desktop app . Is there a way to wrap the cordova plugin api and the node js file in electron and we can load the plugin based on the type ( ie if its cordova the cordova plugin api will be loaded and if it is electron the nodejs will be loaded)? The search got me here but I cant find any documentation about the usage. Any help will be appreciated. Thank you in advance.
The text was updated successfully, but these errors were encountered: