Help guys!
On my android build, everything seems to work fine. But I’m experiencing issue on iOS.
Here’s my code on the JS:
var alarmTime;
$scope.addNotification = function() {
// SET TO 8AM
alarmTime = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
alarmTime.setHours(8);
alarmTime.setMinutes(0);
alarmTime.setSeconds(0);
$cordovaLocalNotification.add({
id: "1234",
date: alarmTime,
message: "Reminder to pray and reflect",
title: "Examen",
sound: "file://sounds/what-friends-are-for.mp3",
smallIcon: "file://img/icon.png",
every: 'day'
}).then(function () {
console.log("The notification has been set");
});
};
$scope.scheduleNotification = function() {
if(localStorage.getItem("dailynotification") == 'true'){
$cordovaLocalNotification.isScheduled("1234").then(function(isScheduled) {
ionicToast.show("Notification is set every "+alarmTime, 'bottom', false, 2000);
});
}
else {
ionicToast.show("Notification is disabled", 'bottom', false, 2000);
}
}
Here’s the error from Xcode:
2016-08-05 07:10:08.743 EXAMEN[17300:584723] -[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0xa000000343332314
2016-08-05 07:10:08.780 EXAMEN[17300:584723] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0xa000000343332314'
*** First throw call stack:
(
0 CoreFoundation 0x000000010be36d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b881deb objc_exception_throw + 48
2 CoreFoundation 0x000000010be3fd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010bd85cfa ___forwarding___ + 970
4 CoreFoundation 0x000000010bd858a8 _CF_forwarding_prep_0 + 120
5 EXAMEN 0x000000010abed283 -[UIApplication(APPLocalNotification) localNotificationWithId:] + 563
6 EXAMEN 0x000000010abed49a -[UIApplication(APPLocalNotification) localNotificationWithId:andType:] + 74
7 EXAMEN 0x000000010abed001 -[UIApplication(APPLocalNotification) localNotificationExist:type:] + 97
8 EXAMEN 0x000000010abe8935 __39-[APPLocalNotification isPresent:type:]_block_invoke + 229
9 libdispatch.dylib 0x000000010ed72d9d _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x000000010ed933eb _dispatch_client_callout + 8
11 libdispatch.dylib 0x000000010ed7bb2f _dispatch_root_queue_drain + 1829
12 libdispatch.dylib 0x000000010ed7b405 _dispatch_worker_thread3 + 111
13 libsystem_pthread.dylib 0x000000010f0d04de _pthread_wqthread + 1129
14 libsystem_pthread.dylib 0x000000010f0ce341 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I hope anyone can help me ASAP.
Thanks!
I’ve opened this issue on Github.