簡體   English   中英

如何防止ios11中的屏幕記錄

[英]how to prevent screen record in ios11

由於某些原因,我們的APP不希望人們記錄屏幕,但在ios11中一個新功能可以讓用戶在那里錄制iphone屏幕,所以是否有一個API或通知指示我用戶正在錄制現在非常感謝你

您可以檢測屏幕是否正在錄制:

UIScreen.main.isCaptured
// True if this screen is being captured (e.g. recorded, AirPlayed, mirrored, etc.)

您無法使用項目設置阻止它,但您可以使用模式或其他東西來請求用戶禁用它。 不確定如何使用您的AppStore提交進行鍛煉。

您可以在iOS 11中使用kvo觀察UIScreenCapturedDidChangeNotification

NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
    [[NSNotificationCenter defaultCenter] addObserverForName:UIScreenCapturedDidChangeNotification object:nil queue:mainQueue usingBlock:^(NSNotification * _Nonnull note) { 
 //code you want execute
}];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM