How can I Test the ngCordova plugins during development (in a Browser)?


#1

Good day,

Since I haven’t found any concrete post(s) about this topic, I’m adding this question.

Is it possible to test the ngCordova plugins during development in the browser (liveReload)?

The flow for using these plugins seem to require that you build the project for a specific platform and deploy it in an emulator to see them in action. If this is the case, it’s a terrible situation for development.

Does it exist a way to Test these Cordova plugins without having to deploy to an emulator?

-J


#2

I don’t know, but really hope there is. It would be just awesome!

I have tested this only with pure Cordova, but I see no reason why Ripple Emulator plugin for Chrome wouldn’t work with Cordova + ionic. At least e.g. accelerometer and GPS can be emulated with Ripple.


#3

Thank you, sir. So, by the looks of it, there isn’t currently a way to do this in the browser directly… bummer!

I’ll take a look at the ripple emulator, however… do you happen to know if you’re required to build the project before testing the app in Ripple?

Thank you once more for your reply,
-J


#4

You don’t need to build anything. I tested Ripple with one of my ionic projects, and Ripple seemed to be quite much compatible with ionic framework.

I ran “ionic serve” and then just enabled the ripple emulator. There weren’t any plugins utilizing Cordova plugins, so I can’t be sure cordova + ionic hardware emulation works with Ripple emulator.

Unfortunately I don’t have time to test it now (deadlines), but I’m curious to know if it works, if you end up testing this. :slight_smile: If not, I guess I’m going to test this.


#5

I will definitely test it soon, man. I need to know how painful is it to develop when you’re using the cordova plugins in an Ionic project. (I will soon need to make heavy use of GeoLocation in a real project)

So, I’ll post my impressions right here, Take care and thanks for your kind replies!

-J


#6

Ripple supports fake geo locations, so if you happen to be lucky, it might shorten the iteration cycle a lot. Btw, couldn’t help googling a bit. Ripple and ionic do seem to work together, see for example this link.

The best of luck with your project!


#7

Did you see this the other month? You can have live reloading in the phone (and emulator too I would guess)
http://ionicframework.com/blog/live-reload-all-things-ionic-cli/
Might be a solution for you!


#8

Hello @campers,

That’s awesome man! Thank very, very much! I guess I should’ve browsed the blog more carefully, is there an advantage to using Ripple instead? What are your opinions? Ripple seems to be more mature somehow.

-J


#9

I haven’t used ripple, unfortunately the live reload doesn’t work on my phone, or maybe it’s my app, I just get a black screen


#10

Hi @jlstr ,

you can use ngCordovaMocks

I hope this helps you.


#11

Ciao @mattiaprovincia (di dove sei?) i have to find how inject ngCordova if app run in sim or device and ngCordovaMocks if it run in a browser! Do you have some suggestions?

Tommaso


#12

A new blog post on ngCordova, the project lead has created a Chrome plugin to provide mock data :smile:

http://ionicframework.com/blog/moving-forward-with-ngcordova/


#13

I have already read this article somewhere, maybe in a link in the @pbernasconi twitter account :smile:

Great Job!


#14

Yes, check out https://github.com/pbernasconi/chrome-cordova.

It supports some of the basic cordova plugins with more coming in the next few weeks.

Write down plugin requests here if you have any!


#15

I would love it if it could support the calendar plugin!


#16

To use Ripple with Ionic use a path and point to the apps www folder.

ripple emulate --path /Users/user/Desktop/app/www