How to handle this error AVAudioSessionErrorCodeMissingEntitlement?

I am trying to integrate with iOS10 CallKit, however, when I try to initialize an audio session after making a phone call, this API “AudioUnitInitialize” will throw this error “AVAudioSessionErrorCodeMissingEntitlement”. According to the document, this is just one explanation: https://developer.apple.com/reference/avfoundation/avaudiosessionerrorcode/avaudiosessionerrorcodemissingentitlement

How do I renew eligibility for support? Does any body have any experience?

+8
ios ios10 audio entitlements callkit
source share
2 answers

I also ran into this issue in iOS10 6 beta and was able to solve it by moving the AudioUnitInitialize API from the performAnswerCallAction: method (as implemented in SpeakerBox) to the init ProviderDelegate init routine.

By moving the initialization earlier in the ProviderDelegate life cycle, the "rights" problem is somehow avoided.

+3
source share

I downloaded the Apple Speakerbox sample application to learn the rights and background modes used for CallKit.

It looks like they are adding a background → voice over IP, and the application "Application provides voice over IP services" application in the Info.plist application:

 <key>UIBackgroundModes</key> <array> <string>voip</string> </array> 

It also adds the INStartAudioCallIntent key to NSUserActivityTypes and the following microphone usage description:

 <key>NSMicrophoneUsageDescription</key> <string>$(PRODUCT_NAME) uses the Microphone for call audio</string> <key>NSCallKitUsageDescription</key> <string>$(PRODUCT_NAME) makes and receives calls</string> <key>NSUserActivityTypes</key> <array> <string>INStartAudioCallIntent</string> </array> 
-one
source share

All Articles