Jana iOS
Jana iOS

Reputation: 13

Local Notification in iOS(Objective C)

I have scheduled the local notification on tomorrow 10 AM and i switched off the mobile and then turn on my mobile day after tomorrow.At this time the notification is not receiving.But I can able to receive the notification, once i meeting the scheduled date and time.So this is possible, to get the notification once crossed the scheduled date and time in iOS?

Upvotes: 0

Views: 89

Answers (1)

KevinSkyba
KevinSkyba

Reputation: 317

Could you please rephrase your question?

From what I understand you say that your local notification is not delivered if the device was not turned on at the scheduled time.

In general, your local notifications are not handled by your app. When you register a local notifiction, iOS is responsible for delivering it. This also means that your app does not have to be running when your local notification is scheduled to be delivered.

When your local notification was meant to be delivered at 10 AM, but your device was turned off from 9:50 to 10:10 AM, your local notification will be lost!

Your app should not rely on delivering that local notification. Your only way of knowing whether a user received your local notification is when he opens your app by clicking on the notification or using one of its actions. Your app will then be called by application:didReceiveLocalNotification when it is in the background, or regular by application:didFinishLaunchingWithOptions: when it was killed before.

TL;DR: You should not care whether a user received a local notification, as there is no way to make sure he receives it under certain conditions.

Upvotes: 1

Related Questions