Skip to content

Instantly share code, notes, and snippets.

@ochim
Created June 21, 2017 04:55
Show Gist options
  • Select an option

  • Save ochim/fa998fb91a527ae498f2c2a92cadfa2c to your computer and use it in GitHub Desktop.

Select an option

Save ochim/fa998fb91a527ae498f2c2a92cadfa2c to your computer and use it in GitHub Desktop.
[ios]Manually Requesting Permission to Record Audio
AVAudioSession.sharedInstance().requestRecordPermission { granted in
    if granted {
        // User granted access. Present recording interface.
    } else {
        // Present message to user indicating that recording
        // can't be performed until they change their preference
        // under Settings -> Privacy -> Microphone
    }
}
  • iOS10からは、Info.plist file でNSMicrophoneUsageDescription keyでの説明文が必要
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment