My iOS6 and working code to set bluetooth as an output:
// create and set up the audio session
AVAudioSession* audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory: AVAudioSessionCategoryPlayAndRecord error: nil];
[audioSession setActive: YES error: nil];
// set up for bluetooth microphone input
UInt32 allowBluetoothInput = 1;
OSStatus stat = 0;
stat = AudioSessionSetProperty (
To expand on my previous answer and comment:
You would use the AVAudioSession method
- (BOOL)setCategory:(NSString *)category withOptions:(AVAudioSessionCategoryOptions)options error:(NSError **)outError
In your reply you say
that is not the same because that would allow A2DP bluetooth only
But according to the Apple docs
Allows Bluetooth handsfree devices to appear as available input routes.
I understand that to mean bluetooth HFP, which I presume is what you are after. As regards "forcing", Apple is not too keen on apps forcing/overriding OS control of a user's experience of device behaviour.
It may be that this does not work in practice - I have not been able to test it. Presumably you have, and it fails (you don't indicate in your question). But you are hitting the limits of Apple's documentation on this issue. If you really can't get it to work I would be inclined to go with the deprecated C interface, and be prepared to make changes for iOS8.