Screen recording microphone only works during the session that grants the microphone permission in pop-up dialog. After you kill and relaunch the app, the pop-up dialog won’t show up (which is expected based on the documentation), but the microphone sound won’t be included in the recording (in-app sound will). It seems like the system is remembering the permission wrong, and automatically start the recording without including microphone input.
The error can be easily reproduced with the modified codes from Unity documentation
using System;
using UnityEngine;
#if PLATFORM_IOS
using UnityEngine.iOS;
using UnityEngine.Apple.ReplayKit;
public class Replay : MonoBehaviour
{
string lastError = "";
void OnGUI()
{
if (!ReplayKit.APIAvailable)
{
return;
}
var recording = ReplayKit.isRecording;
string caption = recording ? "Stop Recording" : "Start Recording";
if (GUI.Button(new Rect(10, 10, 500, 200), caption))
{
try
{
recording = !recording;
if (recording)
{
// enable microphone
ReplayKit.StartRecording(true);
}
else
{
ReplayKit.StopRecording();
}
}
catch (Exception e)
{
lastError = e.ToString();
}
}
GUI.Label(new Rect(10, 220, 500, 50), "Last error: " + ReplayKit.lastError);
GUI.Label(new Rect(10, 280, 500, 50), "Last exception: " + lastError);
if (ReplayKit.recordingAvailable)
{
if (GUI.Button(new Rect(10, 350, 500, 200), "Preview"))
{
ReplayKit.Preview();
}
if (GUI.Button(new Rect(10, 560, 500, 200), "Discard"))
{
ReplayKit.Discard();
}
}
}
}
#endif
Anyone has the same issue? Any guidance would be much appreciated, thanks!
I also filed a bug report, case 1162328.