-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TypeError: undefined is not an object (evaluating 'cordova.plugins.notification.local') #1281
Comments
iOS or android? You have to be sure that your plugin is well installed i remmenber after removing adding the platform it does work |
Uninstall and reinstall the plugin. Something has gone wrong at the sort of level. You also should check the the plugin is initialised. |
Normally you just install the plugin and thats it. Sometimes you get a bad download and that screws thing up. I've never had to reinstall the platform for this plugin. Other plugins yes, but not that one. YMMV. |
@rwillett i am not sure if it was or not this plugin :) |
If its working I'll close this issue. |
Sorry, got the wrong person. |
I am testing on a iPhone device, via Phonegap APP. |
Fill out #1188 as you gave not provided anywhere near enough information. Also don't use npm to install. You sound like you are using Phonegap. Are you? |
Yes!! I am using Phonegap!! How can I install not using npm? []s |
Hi!! Thank you guys for your patience and here is the form filled. I would like to know how can i install the plugin not using npm, and the 'best pratices' to get it working fine. I can see people here using it and i'm excidted to use it too. Mobile development is a new world for me.
Installed platforms:
installed with: in file INDEX.JS Expected Behavior Pop up local notification 'Testing 1... 2... 3" Tell us what should happen I expect notification to show up. Actual Behavior Tell us what happens instead The code flows to "catch" section and the exception is: Steps to Reproduce Put the code above in OnDeviceReady section of index.js Start up phonegap server with the command: Access the server via PHONEGAP MOBILE APP In this point, i get the error: Reproduce this issue; include code to reproduce, if relevant Context I do not use xCode or adb Include iOS / Android logs
|
@acgodoi Installation is fairly straightforward. I use cordova, not phonegap so this is coming from the phonegap documentation. Here’s an outdate link http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html
What I do is
- open a terminal window
- cd <path to the root of my project>
- phonegap local plugin add <the https link to the plugin from github>
To verify installation
- phonegap local plugin list
… On Apr 28, 2017, at 6:30 AM, acgodoi ***@***.***> wrote:
Hi!!
Thank you guys for your patience and here is the form filled.
I would like to know how can i install the plugin not using npm, and the 'best pratices' to get it working fine. I can see people here using it and i'm excidted to use it too. Mobile development is a new world for me.
Plugin version: 0.8.5 (https://github.com/katzer/cordova-plugin-local-notifications#ios10)
Platform: Android / iOS
OS version: Windows 10
Device manufacturer / model: Samsung Galaxy S3 / iPhone 5
Cordova version (cordova -v): (phonegap -v) 6.5.0
Cordova platform version (cordova platform ls):
Installed platforms:
android 6.1.2
browser 4.1.0
ios 4.3.1
Available platforms:
amazon-fireos ~3.6.3 (deprecated)
blackberry10 ~3.8.0
firefoxos ~3.6.3
webos ~3.7.0
windows ~4.4.0
wp8 ~3.8.2 (deprecated)
**Plugin config:**
installed with:
phonegap plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
in file INDEX.JS
...
onDeviceReady: function() {
var d = new Date();
var now = d.getTime();
try{
cordova.plugins.notification.local.schedule({
id : "2",
at: new Date(now + 10000),
text : "Testing 1..2..3"
});
} catch (e) {
console.log(e);
alert(e);
}
...
Expected Behavior
Pop up local notification 'Testing 1... 2... 3"
Tell us what should happen
I expect notification to show up.
Actual Behavior
Tell us what happens instead
The code flows to "catch" section and the exception is:
TypeError: undefined is not an object (evaluating 'cordova.plugins.notification.local')
Steps to Reproduce
Put the code above in OnDeviceReady section of index.js
Start up phonegap server with the command:
phonegap serve
Access the server via PHONEGAP MOBILE APP
In this point, i get the error:
TypeError: undefined is not an object (evaluating 'cordova.plugins.notification.local')
Reproduce this issue; include code to reproduce, if relevant
Context
What were you trying to do?
Debug logs
I do not use xCode or adb
Include iOS / Android logs
ios XCode logs
Android: $ adb logcat
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I don't use phonegap but this sounds like not checking for device ready. I'd be interested in the response. |
Why is onDeviceReady a function on a JSON element? Is that how phonegap does things? |
Closed as no update from original poster. |
Not working here neither, |
Got this issue with Ionic 4, capacitor, iOS and https://github.com/triniwiz/capacitor-datepicker Fixed it, by removing the compiled ios folder, building again, and adding ios with capacitor again. |
Hi guys,
I get this error when trying to schedule a local notification.
I am trying very hard to set this up but i still have this message:
[console.log] TypeError: undefined is not an object (evaluating 'cordova.plugins.notification.local')
I am using this version:
phonegap plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
The test is been made on "phonegap app" on iphone, but i get the same message testing on a android device.
It seems to be some problem with the plugin instalation, but I did it with the command line above.
onDeviceReady: function() {
var d = new Date();
var now = d.getTime();
try{
cordova.plugins.notification.local.schedule({
id : "2",
at: new Date(now + 10000),
text : "Testing 1..2..3"
});
} catch (e) {
console.log(e);
alert(e);
}
The text was updated successfully, but these errors were encountered: