1

I want to develop an iOS application which has following functionalities:

  1. My app should run always and listen events in background even its removed from memory.
  2. It should catch device off & on notifications.

So now I have couple of questions:

  1. Is that possible to always listen events in background?
  2. Device off/on are the system level calls, so can we get any notifications about them?

I googled a lot for it and found some jail break solutions, which I don't want.

My third question is

  • Can we achieve it for non-jailbroken application?

If anyone know something about it then please guide. Thank you.

Viral Savaj
  • 3,379
  • 1
  • 26
  • 39
RJ168
  • 1,006
  • 2
  • 12
  • 22
  • Have you tried searching first? – jyoonPro May 14 '15 at 07:11
  • Yes I did searching and find some ways for display on/off with jail broken devices, but I want to catch device off/on event with non-jailborken OS. – RJ168 May 14 '15 at 07:12
  • There are lot of guidelines from apple that we want to follow when creating an application for iPhone.It is possible to run your app in background by enabling the background fetch.But it also have lot of limitation. – Gireesh K May 14 '15 at 07:37

1 Answers1

2

Short answer: nope.
Your application can be subscribed to push notifications, and system can wake or launch it (not always! stack question) when notification comes.
Besides this, you can't listen to any events while in background for more than few minutes, unless you have a good reason (like GPS app): Implementing Long-Running Tasks.
Finally, you can't listen to system events like on/off on non-jailbroken phone.

Community
  • 1
  • 1
Maciej Kozieł
  • 959
  • 11
  • 24