title: Theos inter-app communication using mach ports
body: <p>I am trying to send data between an App and a console app (using theos) on iOS 8.</p>
  
  <p>I have tried:</p>
  
  <p><strong>Application</strong>:</p>
  
  <p><code>CFMessagePortRef port = CFMessagePortCreateLocal(kCFAllocatorDefault, CFSTR("co.test"), &amp;message_callback, NULL, NULL);</code></p>
  
  <p>This works fine. <code>NSLog(@"%@", port)</code> returns:</p>
  
  <p><code>&lt;CFMessagePort 0x17018bef0 [0x198094f50]&gt;{locked = Maybe, valid = Yes, remote = No, name = co.test, source = 0x0, callout = message_callback (0x1000e979c), context = &lt;CFMessagePort context 0x0&gt;}</code></p>
  
  <p><strong>However when trying to do the same thing on the console app:</strong></p>
  
  <p><code>CFMessagePortRef port = CFMessagePortCreateLocal(kCFAllocatorDefault, CFSTR("co.test"), 
  &amp;message_callback, NULL, NULL);</code></p>
  
  <p>I always get the error:</p>
  
  <blockquote>
    <p>*** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xc03, name = 'co.test'</p>
  </blockquote>
  
  <p>Even though I am using the same <code>com.apple.security.application-groups</code> entitlement for both:</p>
  
  <pre><code>&lt;key&gt;com.apple.security.application-groups&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;co.test&lt;/string&gt;
  &lt;/array&gt;
  </code></pre>
  
  <p>Can anyone shed any light - maybe the above is a terrible approach and I am missing an easier way to accomplish my goal?</p>
  
  <p>My goal is to be able to pass a NSDictionary between an app running on SpringBoard and a daemon built with theos.</p>
  
  <p><strong>Note: I have no intention of distributing this app on the app store</strong></p>