I need to turn on the speaker when calling from the application. I can successfully enable it, but I cannot disable it.
I am using this method:
[[UIDevice currentDevice] setProximityMonitoringEnabled:NO]; NSLog(@"%d",enable); UInt32 route; route = enable ? kAudioSessionOverrideAudioRoute_Speaker : kAudioSessionOverrideAudioRoute_None; AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute, sizeof(route), &route);
Thanks in advance.
source share