On a jailbroken iOS device, is it possible for one app to call a method from another app (an instance method, not a static one)? Another way of phrasing this: how can I get the instance of an app (assuming the app is running) so that I can call one of its methods?
Background: I am trying to call a function in the Music player app from a hooked method in the iPodUI
Private Framework (see this post for more details).
This question has been asked for Android, but I didn't find anything for jailbreak iOS. If that's because I'm asking the wrong question and there's a different approach to take, I'm open to that.
CPDistributedMessagingCenter
) will help you. That would be useful if you know the other app (e.g. Music player) is already coded to listen for a particular notification / message. If you just want to call an arbitrary method in another app, that isn't designed to be called by other processes, then I think you need MobileSubstrate hooking. – DulciaCPDistributedMessagingCenter
and hooking, so that the music player has a new server/listener ... sure, you could do that. I guess the question is whether you need to pass parameters to this method. If you don't, thenCPDistributedMessagingCenter
is not necessary, and you can use any of several notification mechanisms. – Dulcia