I am creating a UILocalNotification
with a particular date.
I want to test the reminders that I set for different days. I also want to see if the repetition feature works. Is it possible to force the current time to different date and time so I can see whether it works?
Well one way that I used to do it is to actually change the time and date on my iPhone itself through the Settings app.
If you don't know where to do this, here's a wikihow article.
If you pass the time/date when the notification is supposed to go off, your iPhone will automatically make it go off.
As David pointed out, you have to check by changing the date and time on your phone. But I would also like to point out something.
The default timeZone()
of a notification is set according to your location. So even if you manually change the device date and time, the notification will not fire up. For it to work properly you need to set the timeZone()
to systemTimeZone()
. You can try this:
notification.timeZone = NSTimeZone.systemTimeZone()
Hope this helps. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With