Software Archive
Read-only legacy content
17061 Discussions

Can't run third party plugin from git repo

Olivier_C_1
Beginner
406 Views

Hello there,

I  started a project from a HTML5+Cordova template, using App Designer. I choose the ionic framework.

I then added ng-cordova.js that I downloaded from https://github.com/driftyco/ng-cordova/tree/master/dist

Finally, I added the plugin trough the plugin manager using the repo git :

https://github.com/katzer/cordova-plugin-local-notifications.git

Intel XDK responds with a "Plugin added succesfully".

However, when I test my app on "App Preview", with IOS 8.0,  I got the message on the debug console :

Error: undefined is not an object (evaluating '$window.cordova.plugins.notification.local')

I have the same message using the datePicker.

However, when I get plugins available  from the Plugin Source, using the Plugin ID it works find : vibration, geolocation for instance.

Am I missing a point ?

What is the best procedure to debug such a problem?

Regards

Olivier

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
406 Views

Olivier -- you're correct. The Debug tab works with third-party plugins when targeting Android. I recommend you do the bulk of your debugging with an Android device. Once you are happy that things are working well, debug on iOS to insure that things work there. To debug code associated with third-party plugins on iOS (or Windows) requires using weinre or, if you have a Mac, you can build a debuggable version of your app and use Safari to debug the app directly over USB.

View solution in original post

0 Kudos
6 Replies
Amrita_C_Intel
Employee
406 Views

You should choose import local plugin instead of Git repo.

0 Kudos
Olivier_C_1
Beginner
406 Views

Amrita C. (Intel) wrote:

You should choose import local plugin instead of Git repo.

Thank you Amrita for your answer, butI see no difference between the two methods.

And actually, the code is identical by "github repo" or by "import local"

 

0 Kudos
PaulF_IntelCorp
Employee
406 Views

Olivier -- App Preview can only be used to debug code that references the core Cordova plugins. There are not third-party plugins in that container. You need to use the Debug tab or a built app to test functionality associated with a third-party plugin. See these two webinars for more details:

0 Kudos
Olivier_C_1
Beginner
406 Views

Paul F. (Intel) wrote:

Olivier -- App Preview can only be used to debug code that references the core Cordova plugins. There are not third-party plugins in that container. You need to use the Debug tab or a built app to test functionality associated with a third-party plugin. See these two webinars for more details:

Thank you Paul.

I was not accurate enough in my question : I got the error on App Prev using the Debug Tab.

I lwatched the 2 webinars. Just to be sure : can I debug the datepicker plugin or the local Notification plugin with the Debug Tab  on IOS ?

From the table in Debug and Test Overview it seems to me that it is not possible. The only solutions are either the Web Inspector Remote or the Weinre ?

Correct me if I am wrong.

Regards

Olivier

0 Kudos
PaulF_IntelCorp
Employee
407 Views

Olivier -- you're correct. The Debug tab works with third-party plugins when targeting Android. I recommend you do the bulk of your debugging with an Android device. Once you are happy that things are working well, debug on iOS to insure that things work there. To debug code associated with third-party plugins on iOS (or Windows) requires using weinre or, if you have a Mac, you can build a debuggable version of your app and use Safari to debug the app directly over USB.

0 Kudos
Olivier_C_1
Beginner
406 Views

Thank you very much Paul. It is very clear now.

Regards

Olivier

0 Kudos
Reply