{"action":"created","issue":{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/413","labels_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/413/labels{/name}","comments_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/413/comments","events_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/413/events","html_url":"https://github.com/katzer/cordova-plugin-local-notifications/issues/413","id":57379917,"number":413,"title":"Adding new Local Notification crashes app (iOS8 Simulator)","user":{"login":"breth84","id":2384410,"avatar_url":"https://avatars.githubusercontent.com/u/2384410?v=3","gravatar_id":"","url":"https://api.github.com/users/breth84","html_url":"https://github.com/breth84","followers_url":"https://api.github.com/users/breth84/followers","following_url":"https://api.github.com/users/breth84/following{/other_user}","gists_url":"https://api.github.com/users/breth84/gists{/gist_id}","starred_url":"https://api.github.com/users/breth84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breth84/subscriptions","organizations_url":"https://api.github.com/users/breth84/orgs","repos_url":"https://api.github.com/users/breth84/repos","events_url":"https://api.github.com/users/breth84/events{/privacy}","received_events_url":"https://api.github.com/users/breth84/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-11T21:28:16Z","updated_at":"2015-02-24T02:58:18Z","closed_at":null,"body":"I've been trying to get Local Notifications to work within an Ionic app, but when arrive the notification app exit with this error:\r\n\r\nApplication Specific Information:\r\n*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CDVDevice didReceiveLocalNotification:]: unrecognized selector sent to instance 0x7ca69520'\r\nterminating with uncaught exception of type NSException\r\nabort() called\r\nCoreSimulator 110.4 - Device: iPhone 6 - Runtime: iOS 8.1 (12B411) - DeviceType: iPhone 6\r\n\r\nI state that I have tried various solutions proposed on this page \"https://github.com/katzer/cordova-plugin-local-notifications/issues/309\" , and checking the files I have the latest version that includes the so-called changes , can anyone help me? \r\n\r\nthanks in advance\r\n\r\nThis my function:\r\n\r\n      function SetNotification(IdMess,messaggio,dataScadenza){\r\n\t              var idProdottoNotificato = IdMess.toString();\r\n\t              window.plugin.notification.local.hasPermission(function () {\r\n\t\t\r\n \t\t\tdataScadenza.setHours(12);\r\n\t\t\t\r\n\t\t\tvar now  = new Date().getTime(),\r\n    \t\t\t_60_seconds_from_now = new Date(now + 60*1000);\r\n\t\t\t\t\r\n\t\r\n\t\t\twindow.plugin.notification.local.add({ \r\n\t\t\t\t\tid: idProdottoNotificato,\r\n\t\t\t\t\tdate: _60_seconds_from_now,\r\n\t\t\t\t\tmessage: messaggio,\r\n\t\t\t\t\tsound : \"www/sounds/beep.caf\",\r\n\t\t\t\t\tbadge: 1,\r\n\t\t\t\t\trepeat: \"daily\",\r\n\t\t\t\t\tautoCancel: true\r\n\t\t\t\t});\r\n\t\t\r\n\t });\r\n\t\t\r\n      }\r\n\r\nThis my $scope:\r\n\r\n          $scope.AggiungiProdotto= function(DispensaSelezionata) {\r\n\t\t\t    var t = $scope.DispensaSelezionata;\r\n\t\t\t\tvar n = $scope.NomeProdotto;\r\n\t\t\t\tvar d = GetFormatDate($scope.DataScadenza);\r\n\t\t\t\tvar g = $scope.GiorniPreavviso;\r\n\t\t\t\tvar IdMess = \"\";\r\n\t\t\t\tvar now = new Date(); \r\n\t\t\t\tvar DPreavv = FunSubtractDays(d,g);\r\n\t\t\t\t\t\t\r\n\t\t\t\tconsole.log(n, t, d, g);\r\n\t\t\t\t\r\n\t\t\t\tif(n==undefined || t == undefined){\r\n\t\t\t\t\t $ionicPopup.alert({\r\n\t\t\t\t\t\t  title: 'Errore',\r\n\t\t\t\t\t\t  content: 'inserisci nome prodotto e/o dispensa'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif(d==undefined){\r\n\t\t\t\t $ionicPopup.alert({\r\n\t\t\t\t\t\t  title: 'Errore',\r\n\t\t\t\t\t\t  content: 'inserisci la data di scadenza'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\telse if (DPreavv< now) {\r\n\t\t\t\t\tconsole.log(DPreavv, d, now);\r\n\t\t\t\t\t\t$ionicPopup.alert({\r\n\t\t\t\t\t\t\t  title: 'Errore',\r\n\t\t\t\t\t\t\t  content: 'La data di preavviso non può superare la data di scadenza'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t\r\n\t\t\t\tdbRemindUse.transaction(function(e) {\r\n\t\t\t\t\tvar i = \"INSERT INTO prodotti (nome, iddispense, datascadenza, giornipreavviso) VALUES (?, ?, ?, ?)\";\r\n\t\t\t\t\te.executeSql(i, [n, t, d, g], function() {\r\n    \t\t\t\t     $ionicPopup.alert({\r\n\t\t\t\t\t\t  title: 'Fatto',\r\n\t\t\t\t\t\t  content: 'Prodotto Inserito'\r\n\t\t\t\t\t\t }).then(function(res) {\r\n    \t\t\t\t\t\t\t\t window.location.reload(true);    \r\n \t\t\t\t\t\t});\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ti = \"SELECT last_insert_rowid() as IdProdottoIns\";\r\n\t\t\t\t\t\t\te.executeSql(i, undefined, function(e, t) {\r\n\t\t\t\t\t\t\t\tif (t.rows.length) {\r\n\t\t\t\t\t\t\t\t\tfor (var r = 0; r < t.rows.length; r++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar row = t.rows.item(r);\r\n\t\t\t\t\t\t\t\t\t\t\t\tIdMess = row.IdProdottoIns;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t//setta notifica\r\n\t\t\t\t\t\t\t\t\t\t SetNotification(IdMess, n + \" In Scadenza\", DPreavv);\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}, error)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}, error)\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/comments/75689818","html_url":"https://github.com/katzer/cordova-plugin-local-notifications/issues/413#issuecomment-75689818","issue_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/413","id":75689818,"user":{"login":"shi11","id":152899,"avatar_url":"https://avatars.githubusercontent.com/u/152899?v=3","gravatar_id":"","url":"https://api.github.com/users/shi11","html_url":"https://github.com/shi11","followers_url":"https://api.github.com/users/shi11/followers","following_url":"https://api.github.com/users/shi11/following{/other_user}","gists_url":"https://api.github.com/users/shi11/gists{/gist_id}","starred_url":"https://api.github.com/users/shi11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shi11/subscriptions","organizations_url":"https://api.github.com/users/shi11/orgs","repos_url":"https://api.github.com/users/shi11/repos","events_url":"https://api.github.com/users/shi11/events{/privacy}","received_events_url":"https://api.github.com/users/shi11/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T02:58:18Z","updated_at":"2015-02-24T02:58:18Z","body":"I was having a similar problem. What solved my issue was setting id to a Number or a strictly numeric string. When my id had letters in it, it crashed. Hope that helps someone. \r\n\r\nThe documentation does say it can be NaN, but it's either broken or perhaps the documentation should change the id type to Number.\r\n\r\n> Note: The notification ID must be a string which can be converted to a number (that is, isNaN() returns false for). If the ID has an invalid format, it will silently be changed to 0 and will override an earlier one with the same ID."}}