防止 Xamarin iOS 中的屏幕捕获

问题描述 投票:0回答:1

我想防止在 ios xamarin 项目中捕获敏感信息。

我已经有了这个插件,但如果我只想使用iOS屏幕保护代码,而不是整体实现它。 由于Xamarin项目未更新且与maui插件不兼容,

https://github.com/FabriBertani/Plugin.Maui.ScreenSecurity/blob/main/Plugin.Maui.ScreenSecurity/Platforms/iOS/Protections/ScreenshotProtectionManager.cs

需要遵循什么流程?

xamarin.forms mobile plugins xamarin.ios screenshot
1个回答
0
投票

如果您愿意使用插件,我建议使用这个插件,

https://github.com/FabriBertani/Plugin.Maui.ScreenSecurity

使用起来也非常简单,只需创建一个对象并在出现和消失中使用正确的方法即可。另请阅读此插件的免责声明,以便您了解有哪些限制

添加使用:

using Plugin.Maui.ScreenSecurity;

public Ctor()
{
   screenSecurity= ScreenSecurity.Default;
}

protected override void OnAppearing()
{
    base.OnAppearing();
    screenSecurity.ActivateScreenSecurityProtection();
}

protected override void OnDisappearing()
{
    screenSecurity.DeactivateScreenSecurityProtection();
    base.OnDisappearing();
}

如有疑问请告诉我

© www.soinside.com 2019 - 2024. All rights reserved.