Bring managed iOS client to feature parity
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s
.NET port / cpp-conformance (push) Canceled after 0s
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s
.NET port / cpp-conformance (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using Foundation;
|
||||
|
||||
namespace VoiceCat.iOS;
|
||||
|
||||
internal static partial class IosScreenCapture
|
||||
{
|
||||
internal static void Present()
|
||||
{
|
||||
if (!OperatingSystem.IsIOSVersionAtLeast(27)) return;
|
||||
NSUrl? root = NSFileManager.DefaultManager.GetContainerUrl(IosConstants.AppGroup);
|
||||
if (root?.Path is null) throw new InvalidOperationException("The VoiceCat App Group is unavailable.");
|
||||
string path = Path.Combine(root.Path, "voicecat", "broadcast_audio.ring"); Directory.CreateDirectory(Path.GetDirectoryName(path)!);
|
||||
if (Available() == 0) throw new InvalidOperationException("Screen audio sharing is unavailable on this device."); PresentNative(path);
|
||||
}
|
||||
|
||||
[LibraryImport("__Internal", EntryPoint = "vc_ios_screen_capture_available")]
|
||||
private static partial int Available();
|
||||
[LibraryImport("__Internal", EntryPoint = "vc_ios_screen_capture_present", StringMarshalling = StringMarshalling.Utf8)]
|
||||
private static partial void PresentNative(string ringPath);
|
||||
[LibraryImport("__Internal", EntryPoint = "vc_ios_screen_capture_stop")]
|
||||
internal static partial void Stop();
|
||||
}
|
||||
Reference in New Issue
Block a user