0

I have a view containing 4 buttons:

  • Home
  • Lock
  • Volume up
  • Volume down

all I'm trying to make is that when you press one of these buttons, my app should do some communication with the device to simulate one of these buttons.

Example: If I click the home button exists within my app, is the same as I press home button in device.

This kind of thing is possible? jailbreak is necessary for this?

Belzum Nulls
  • 41
  • 1
  • 1
  • 9

2 Answers2

2

None of these functions are available to you if you want to get your app accepted into the App Store. For a while some apps accessed private API's in AVSystemController however it seems recently apps using this method are being rejected. (Although some apps still using the method seem to be left in the app store)

If you want to go down the jailbreak route you'll have to dig into private API's and the headers of the various frameworks.

Also just a note, Apple provides some sort of interface like this through their accessibility options.

Jamie Maddocks
  • 215
  • 1
  • 6
1

To do what you are after would go against Apple Review Guidelines so it will get your app rejected under

2.5 - Apps that use non-public APIs will be rejected

You are not allowed to take the functionality of the Home and Lock away from these buttons and put it within your application.

Though I will not say it is impossible to do if your app is for jailbroken devices. Such as to exit your app you can do exit(0); though I still wouldn't recommend it as it makes it look as though your app has crashed when it hasn't.

For the volume control you can do this with the use of MPVolumeView I would recommend having a read of the Apple Documentation and this question iOS: Accessing device hardware audio volume control

Community
  • 1
  • 1
Popeye
  • 11,839
  • 9
  • 58
  • 91
  • Hey I do some search and find this: http://stackoverflow.com/questions/20998318/simulate-all-physical-buttons-like-the-pressure-on-the-home-button-on-ios-7-jai – Belzum Nulls Nov 19 '14 at 23:32
  • He used this command: [[%c(SBUIController) sharedInstance]clickedMenuButton];, this works? – Belzum Nulls Nov 19 '14 at 23:33
  • I've never seen that command before, so it is probably something that can be done on jailbroken devices but not apps that are going into the app store. Like I have said you can't alter or remove or re-assign the function of those buttons for apps that are going into the app store. – Popeye Nov 20 '14 at 08:19