Search Issue Tracker

Won't Fix

Votes

6

Found in

2019.4

2020.2

2020.2.0b1

Issue ID

1276572

Regression

No

[iOS] Audio files are not played when using CallKit

iOS

-

Reproduction steps:
1. Download and open the attached "BugReproProject" project
2. In the Menu bar, press "File" > "Build Settings..."
3. Switch to iOS platform, build and deploy the project
(The following steps are made on the device)
4. Press the "PLAY AUDIO" button (an audio clip starts playing)
5. Press the "CALL" button (audio clip stops playing) and then the "END CALL" button
6. Press the "PLAY AUDIO" button again

Expected result: An audio clip starts playing
Actual result: Audio clip doesn't start playing

Reproduces on: 2019.4.12f1, 2020.1.9f1, 2020.2.0b7
Could not test with: 2018.4, 2021.1 (Console errors)

Tested with:
iPhone 6 (iOS 12.4.8)
iPhone 6s (iOS 13.3.1)
iPhone 7 (iOS 12.3.1)

  1. Resolution Note (2021.2.X):

    On iOS Unity uses AVAudioSession for audio playback. Unity takes care of different interuptions and state changes of AVAudioSession to keep audio playing. From OS standpoint disabling app's AVAudioSession does not count as interuption or notifiable state change, as AVAudioSession active state can only be changed with intent from user. In this case disabling of AVAudioSession happens when a call is ended, user is notified of this in CXProviderDelegate provider:didDeactivateAudioSession: method. Disabling AVAudioSession is destructive operation so we do not recommend using it.
    In case AVAudioSession has been disabled Unity audio can be restored calling AudioSettings.Reset() in C# script or UnitySetAudioSessionActive() in native plugin. These calls do restore audio, but they resets audio state as well, meaning all audio sources in the scene are stopped.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.