0

I am writing to do recording in background. I have an API that is working fine. Now I want to make tweak using that API but the only problem giving access of microphone. As for UI apps dialog appears "TestApp" would like to Access the Microphone.

I want my recording tweak to have access of microphone and I have to do it without dialog box. I m using Xcode 5 with iOS 7.x.

Thanks in advance.

Ahad Khan
  • 411
  • 2
  • 18

1 Answers1

0

As of iOS 7 microphone is protected by entitlement. Without it you either will be denied in access completely (in case of a daemon which doesn't have UI thus can't request permission from user) or app will show the dialog box. In order to access it you need to sign your app with entitlement:

<key>com.apple.private.tcc.allow</key>
<array>
    <string>kTCCServiceMicrophone</string>
</array>

If you're building a tweak then you can't just sign it with that. The process that your tweak is loaded into has to have that entitlement. For example, SpringBoard already signed with it and can access microphone without user permission. SpringBoard tweak will have access to microphone.

If you're building a daemon or UI app then just sign it with the entitlement.

creker
  • 9,400
  • 1
  • 30
  • 47
  • I tried both scenarios but it logs "Microphone input permission refused - will record only silence" in tweak as well as in daemon. – Ahad Khan Jul 03 '14 at 10:02
  • In tweak I get these warnings " Unable to get entitlements for client task. "The operation couldn’t be completed. task does not have entitlement: com.apple.private.icfcallserver

" – Ahad Khan Jul 04 '14 at 11:24
  • Sorry, it works for me. As a test I wrote console application that records audio using Audio Queue API. Without the entitlement I get empty file and no errors in the console. After signing with the entitlement it started recording. – creker Jul 04 '14 at 16:12
  • I try to run my code in fresh tweak. But it hangs iPhone. Its may be I m calling my code in wrong context. Could you please give me sample code to that just do loging. I ll add my code there. – Ahad Khan Jul 07 '14 at 11:37