2 Replies
      Latest reply on Sep 15, 2017 4:14 AM by Troikaa
      Troikaa Level 1 Level 1 (0 points)

        Hello Apple,

          We have an event soon and need to show our medical app so please help and resolve my query as soon as possible .



        We are developing Medical Application for Medical representative (User) . They will install our app in iOS devices and demonstrate medicine product to doctor. Our app has Audio recording functionality as we need to analyze doctor's review for the product during the presentation.

        So the recording works fine  in background as well as foreground mode.  But in some cases it is not working. Below i have briefed one scenario which could be a frequent case for us.

        In the app we are using .key file which is containing text, video and animation so user click on key file then we open that file in Apple Keynote App. As soon as it will be copied to keynote app, Our LBM app is starting audio recording in background. Now when user will start keynote presentation by clicking on play button, It is working fine until any slide is not containing video. As soon as slice which contains video will start to run, The audio recording that we have started in our LBM app is stoped recording.

        Note: When Recording starts at that time our LBM app is in background mode. And Apple's Keynote will be in foreground mode.

        We have done below thing in our code.

        1) In Info.plist file set Audio Flag  : Privacy - Microphone Usage Description

        2) In Capabilities -> Background Mode -> Audio,Airplay and Picture in Picture

        3)  Use below function in didFinishLaunchingWithOptions Methods

        func audioSessionSettings() {

                do {

                    try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryRecord, with: AVAudioSessionCategoryOptions.mixWithOthers)


          try AVAudioSession.sharedInstance().setActive(true)


                    var error: Error?

                    try? AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)

                    if error != nil {



                } catch let error {




        Thanks in advance