0

I have a tweak with hooks to an app (tweak1) The tweak is supposed to use a framework to execute some code. Unfortunately within iOS7 I'm unable to do that.

However when the same code is executed in a separate tweak (tweak2) with hooks to springBoard, it runs just fine.

My question is possible for me to send a dictionary from the first tweak (tweak1) to tweak2 so it gets executed.

I think I need to use CPDistributedNotificationCenter. But not sure. If that's the case, a helping suggestions or example would be greatly appreciated.

many thanks

boudarbalat
  • 181
  • 1
  • 8

1 Answers1

2

CPDistributedNotificationCenter should work or you could just use NSDistributedNotificationCenter. It inherits from NSNotificationCenter, which we all know how to use.

Another solution I can suggest is CFMessagePort, which I'm using in my apps. I need to support iOS 4, which doesn't support NSDistributedNotificationCenter, so I ended up using CFMessagePort. It differs from notification model in that you can't send messages to everyone. You can only send messages between two known ports. But in your case it probably doesn't matter.

There is also the XPC API but I've never used it and can't say much about it. It's an IPC API so it should work. Many iOS components use it.

creker
  • 9,400
  • 1
  • 30
  • 47
  • Thanks for the answer. I've actually started testing with CPDistributedNotificationCenter. Unfortunately I'm getting this error when the tweak tries to inject deny mach-lookup – boudarbalat Jan 12 '14 at 04:17
  • What app are you hooking with that tweak? "deny mach-lookup" - it looks like app you are hooking is sandboxed. – creker Jan 15 '14 at 19:35
  • 1
    I was trying to use Gremlin framework for importing media. I got around the problem by using springboard to execute what i wanted. – boudarbalat Jan 15 '14 at 19:56