I think you would be better off using the IIS SDK Notification api service. This will be the cleanest way to achieve what you want.
Conceptually, Apple does not intend (third parties) to release system events, since this will not go well with the iOS thorough training model, so people resort to private APIs and jailbreaks. Private APIs, as the name suggests, should not be relied upon.
Think of it this way, unless you are responsible for the whole system that the user application cannot be, you really don't have any business system events. I know how Android does it, but this is another story (not suitable for this topic).
On a Mac, the XPC Services api allows processes to interact with each other, but not quite the way events are generated in the system. I would advise you to use the iOS SDK notification API, which would probably be the cleanest method to achieve what you want. Yes, he goes to Apple and returns to the device, but the mechanism that is still available.
Isaka Jan 08 '14 at 1:01
source share