I’m planning to create a life saving application, and I need to integrate with any of the physical buttons on the iPhone (Home, volume, lock).
Is this possible programmatically when the screen is off (on a non jail-broken device)?
Thanks in advance!
I like your idea, but I don’t think that this will be obtainable on a non-jailbroken device. @Andrews answer could work if your app was triggered by a combination of play/pause, next and back but would require that your app was always the responder to the devices audio controls which is only possible between the time when the user closes your app, and launches anything else that takes control of device audio. (which probably wouldn’t be that long)
Assuming that this would be the iOS version of Life Alert, that would dial emergency services for the user, it would be too difficult to keep the app from generating false positives and calling 911 every time the phone had a few buttons pressed in a pocket, purse, etc. Whereas with a jailbreak it may be possible to listen to a pattern (eg. home button- press, press, hold, press, press)
On top of this attempting to use anything on the lock screen for something other than its intended purpose will most likely result in rejection by Apple. They’re big on user experience, and would want your application in anyway interfering with any of functionality of the device.
Once again, I think you have a good idea, but I’m sorry to say that it just may not be possible to do on iOS. Good Luck!