title: ReplayKit returns error "RPRecordingErrorFailedToStart"
body: <p>I am trying to include recording functionality to my C++ based game with <code>ReplayKit</code>. I check that the iOS version is 9.0 or above in my game code, and if it is, I will call <code>RecordReplayIOS::startRecording()</code> and then the ReplayKit should start recording. </p>
  
  <p>For some reason the <code>startRecordingWithMicrophoneEnabled</code> function returns always an error <code>-5803</code>, which according to API documentation means <code>RPRecordingErrorFailedToStart</code>. Any ideas what I am doing wrong?</p>
  
  <p><code>RecordReplayIOS.hpp</code>:</p>
  
  <pre><code>#ifndef __RECORD_REPLAY_IOS_HPP__
  #define __RECORD_REPLAY_IOS_HPP__
  
  class RecordReplayIOS {
  public:
      static bool canRecord();
      static void startRecording();
      static void stopRecording();
  };
  
  #endif
  </code></pre>
  
  <p><code>RecordReplayIOS.mm</code>:</p>
  
  <pre><code>#include "RecordReplay_ios.hpp"
  #include "ReplayKit/ReplayKit.h"
  
  @interface Recorder : NSObject
  +(void)startRecording;
  +(void)stopRecording;
  @end
  
  #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
  
  bool RecordReplayIOS::canRecord() {
      // ReplayKit needs at least iOS 9
      if (SYSTEM_VERSION_LESS_THAN(@"9.0")) {
          return false;
      }
      return true;
  }
  
  void RecordReplayIOS::startRecording() {
      [Recorder startRecording];
  }
  
  void RecordReplayIOS::stopRecording() {
      [Recorder stopRecording];
  }
  
  @implementation Recorder
  
  +(void)startRecording {
      RPScreenRecorder* recorder = RPScreenRecorder.sharedRecorder;
      recorder.delegate = self;
      [recorder startRecordingWithMicrophoneEnabled:false handler:^(NSError * error) {
          if(error != nil) {
              NSString* desc = error.description;
              return;
          }
      }];
  }
  
  +(void)stopRecording {
      RPScreenRecorder* recorder = RPScreenRecorder.sharedRecorder;
      [recorder stopRecordingWithHandler:^(RPPreviewViewController *previewViewController, NSError *error) {
          if(error != nil) {
              NSString* desc = error.description;
              return;
          }
          if(previewViewController) {
              //do stuff...    
          }
      }];
  }
  
  @end
  </code></pre>