Detect Lock Screen Status

Hello I am developing an App that the user must authendicate himself before running a task.


A local notification shows up and when the user press it from lock screen, after he authendicates himself (in the lock screen's authendication) the app runs a task.

The fact is that when the same notification shows up from home screen, the app runs the task without authendication.


So the problem is that I can't find a way to manipulate differently the notifications from lock screen and home screen OR simply can't find a way to detect whether notification comes from lock screen or home screen. Because I use background task even more simply detecting whether the iphone is locked or unlocked would also solve my problem perfectly.


As I can figure there are 3 ways around this or maybe more

Replies

Unfortunately, there is no API for any of those conditions. Your app, can send a notification

and if the user responds you could launch your app which would then have the info in the

application delegate which you could act on. If they simply dismiss the notification, you get

no response so, you can't know. If they are on the home screen same situation. There are

only two states where you can do anything. #1, when the user selects to launch your app

from the notification and #2, when they app is already running and the notification fires.