Signal-iOS/Signal
Michael Kirk b8ec353d77 Use recommended approach for speakerphone mode
From: https://developer.apple.com/library/content/qa/qa1754/_index.html

Q:  Can you explain the difference between calling the AVAudioSession method overrideOutputAudioPort: with the value AVAudioSessionPortOverrideSpeaker and using the category option AVAudioSessionCategoryOptionDefaultToSpeaker with setCategory:withOptions:error:.

A: The difference is that setting the AVAudioSessionPortOverride by calling overrideOutputAudioPort: is more transient than using the category option AVAudioSessionCategoryOptionDefaultToSpeaker.

Important: The use of both AVAudioSessionPortOverrideSpeaker and AVAudioSessionCategoryOptionDefaultToSpeaker are only applicable to the AVAudioSessionCategoryPlayAndRecord category.
Calling overrideOutputAudioPort: and setting the AVAudioSessionPortOverride to AVAudioSessionPortOverrideSpeaker is a way of temporarily overriding the output to play to the speaker. Any route change or interruption will cause the audio to be routed back to its normal route, following the last-in wins rule. Think of using overrideOutputAudioPort: in terms of what you might use to implement a Speakerphone button where you want to be able to toggle between the speaker (AVAudioSessionPortOverrideSpeaker) and the normal output route (AVAudioSessionPortOverrideNone).

Note: This property is intended to allow 3rd party applications to mimic the behavior of a Speakerphone button and therefore may change the input route as well as output route. For example, setting the AVAudioSessionPortOverride to AVAudioSessionPortOverrideSpeaker while a headset is plugged in will cause the route to change to built-in mic / built-in speaker.

// FREEBIE
2017-07-14 09:49:48 -04:00
..
AudioFiles Fixes #244 2015-03-21 17:53:38 +01:00
Certificates TextSecureKit Refactoring 2015-12-22 23:41:10 +01:00
Fonts Align the message state indicators with the behavior on Android and desktop. 2017-03-20 12:55:35 -04:00
Images Multiple visual enhancements and repo cleanup. 2015-02-18 18:20:02 +01:00
Images.xcassets pixel cleanup in bluetooth speaker image 2017-07-13 17:08:42 -04:00
src Use recommended approach for speakerphone mode 2017-07-14 09:49:48 -04:00
test Add comment and clearer tests per CR 2017-07-12 16:06:35 -04:00
translations extract dismiss string -> CommonStrings.dismissButton 2017-07-13 17:08:41 -04:00
.swiftlint.yml WIP: WebRTC calling 2017-01-12 09:56:05 -05:00
iTunesArtwork@3x.png Updated iTunes artwork 2015-01-30 17:25:24 -10:00
main.m Removing unused imported classes. 2015-07-27 16:19:08 +02:00
Signal-Info.plist Bump build from to 2.14.0.2. 2017-07-13 17:23:28 -04:00
Signal-Prefix.pch Always sync and log push tokens. Apply OWSAlerts in more places. 2017-05-09 10:04:48 -04:00
Signal.entitlements Choose arbitrary attachments from iCloud/GDrive/Dropbox/etc 2017-04-20 18:49:30 -04:00