Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Cordova contacts plugin doesn't work within CADT or in CDE #49

Open
uriva opened this issue Nov 22, 2014 · 2 comments
Open

Cordova contacts plugin doesn't work within CADT or in CDE #49

uriva opened this issue Nov 22, 2014 · 2 comments

Comments

@uriva
Copy link

uriva commented Nov 22, 2014

How do I test my chrome mobile app using chrome-dev-editor if using the cordova contacts plugin?

If I use the "run" option in CDE, then navigator.cotacts is undefined. The same thing happens if I use "realtime deploy" with my phone.

Is there a way to solve this inside CDE? If not - it seems that CADT does not yet support all of cordova default plugins, however you can build it yourself with the additional plugins. How is this done?

@mmocny
Copy link
Member

mmocny commented Nov 25, 2014

There is currently no way to do this. At the moment, CDE deploy-to-mobile can only be used for testing "pure" Chrome Apps (just like CDE Run only tests pure chrome apps).

If you would like to use the contacts plugin (or any cordova plugin) today, you can use our cca command line tool to create, plugin add, build, and finally run your application, since cca is cordova-compatible and supports extending your chrome app with cordova features.

We do want to add support for what you request, eventually. (Details below, but just ignore if its confusing)

Yes, you could build your own version of CADT today to add extra plugins, but actually the one we release already comes with all the cordova core plugins. Unfortunately the problem isn't that simple. The problem is that CADT does not currently know when to enable which third-party plugins. We don't want to just enable them all always, since enabling all plugins may have negative effects on applications that are not written to use them (many plugins clobber globals).

Our plan to address this is two fold.

  • First, CADT should read your cordova plugin metadata file on application load, and enable all the plugins your app requires.
    • That would fix the cca + CADT workflow, where you cca plugin add all plugins and then use cca push to CADT instead of cca run.
  • Second, we would need to update CDE to actually create a plugin metadata file.
    • Today, it does not, since this is purely a cordova thing. I think it may be possible that you can just drop a cordova_plugins.js file into the root of your project, and it would work. We will publish instructions if we get this completed.

@mmocny
Copy link
Member

mmocny commented Nov 25, 2014

Just noticed in #31 that I once had a potentially interesting option for CDE:

Another low-road option is to add a menu to CADT main screen to manually enable plugins?

I still like that idea. Instead of relying on auto-discovery, for CDE deploys, we can just ask the developer to select which plugins to run, and remember the settings in persistent storage.

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

No branches or pull requests

2 participants