Search code examples
objective-ciosjailbreak

iOS prev/next article or page in common apps using hardware volume buttons


I'm trying to develop a tweak on my jailbroken iPhone to change the pages in Reeder, iBooks, etc. using the volume buttons but I'm stuck at the part where I tell the app what to do when I press the buttons. I found out that I can't simulate a touch so what options do I have?

Thanks.


Solution

  • What your going to need to do to tell the app to turn the pages is look through the header files for each app, and find methods that are used to turn the pages. The methods will most likely be different for each.

    Once you've found them your going to need to hook some sort of initialization method and add the objects as an observer of AVSystemController_SystemVolumeDidChangeNotification, and set the selector to the one that you found previously.

    Don't forget to remove the observer when the page view goes away, or when its no longer needed, otherwise you will get a crash.