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

cordova.plugins is undefined #17

Open
DocGreenRob opened this issue Aug 22, 2016 · 10 comments
Open

cordova.plugins is undefined #17

DocGreenRob opened this issue Aug 22, 2016 · 10 comments

Comments

@DocGreenRob
Copy link

I just added this plugin to my appbuilder web ide project and tried to simply use //cordova.plugins.notification.local.schedule({ // id: 1, // title: 'I will bother you every minute', // text: '.. until you cancel all notifications', // sound: null, // every: 'minute', // autoClear: false, // at: new Date(new Date().getTime() + 10 * 1000) //});

and I get the error above.

@EddyVerbruggen
Copy link

Did you wait for deviceready to fire?

@DocGreenRob
Copy link
Author

yes. I added the plugin, then added this code on a button click event, so well after the deviceready fired...

@EddyVerbruggen
Copy link

And you're running it in a webbrowser?

@DocGreenRob
Copy link
Author

Yes

@EddyVerbruggen
Copy link

Browsers don't implement the Local Notification API so you really need to use a device / simulator.

@DocGreenRob
Copy link
Author

Incorrect. I am using the WebBrowser IDE to develop the app but testing Local Notification API on my device as I am well aware of this limitation. Nevertheless, during debugging I get cordova.plugins is undefined... Please do not close this ticket as I need HELP!

@EddyVerbruggen
Copy link

I asked "And you're running it in a webbrowser?" and you said "Yes" so I think my respons was not incorrect. It's just that you thought I meant "IDE" whereas I meant "app".

Share your app with me and I may take a look.

@EddyVerbruggen
Copy link

This code has no method tied to a button and no active cordova.plugins.noti.. code (commented) so it's hard for me to tell what exactly is/was live while you observe the error.

That being said the code looks reasonable to me. Do other plugins (like Toast which you've included as well) work?

@DocGreenRob
Copy link
Author

Thanks for that second question as Toast gives same error, plugin undefined. Notice that the cordova.plugins.notification.local.schedule is called in the app.js line 48. Check it out and you will see it is after deviceready... let me know your findings...

@DocGreenRob
Copy link
Author

@EddyVerbruggen any update on the file I shared with you? (Did you discover anything helpful?)

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

No branches or pull requests

2 participants