rogermushroom
rogermushroom

Reputation: 5586

Can iOS receive broadcasts like Android?

I would like my app to be informed when a headset/headphones is disconnected from an iOS device after a period of idle time long enough for the app to have been cleaned up (and thus might not be running) similar to how a BroadcastReceiver works in android. I suspect it's not possible but would appreciate any ideas.

I have looked into local and push notifications and the NSNotificationCenter. Push notifications aren't appropriate because events happen on the device. It only seems possible to schedule (by specifying a time) local notifications and not create them from system events and notifications from the NSNotificationCenter are only received when the app is running.

Have I misinterpreted any of the information above or is there another trick to use?

Upvotes: 5

Views: 9087

Answers (1)

rogermushroom
rogermushroom

Reputation: 5586

Background processes and system event based broadcast receivers for an application that isn't running aren't possible in the current version (iOS 6) and any previous versions. There are no plans to make it possible that I have come across.

As stated in the question, it is possible to use the NSNotificationCenter to achieve a similar affect but only if events that trigger the notifications are external to the phone or the notifications can be triggered from predetermined time.

Upvotes: 3

Related Questions