setAudioSessionOperationRestriction abstract method

Future<void> setAudioSessionOperationRestriction(
  1. AudioSessionOperationRestriction restriction
)

Sets the SDK's permission to operate the Audio Session.

By default, both the SDK and the App have permission to operate the Audio Session. If you only want the App to operate the Audio Session, you can call this method to restrict the SDK's permission. This method can be called before or after joining a channel. Once called, the restriction takes effect when the SDK needs to modify the Audio Session. This method is applicable to iOS only. This method does not restrict the App's permission to operate the Audio Session.

  • restriction SDK's permission to operate the Audio Session. See AudioSessionOperationRestriction. This parameter is a bit mask, where each bit corresponds to a permission.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> setAudioSessionOperationRestriction(
    AudioSessionOperationRestriction restriction);