Last active
July 5, 2021 17:17
-
-
Save TBertuzzi/1609de7a399041d009d17de3659e7574 to your computer and use it in GitHub Desktop.
Segurança Xamarin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class AppDelegate : UIApplicationDelegate | |
{ | |
NSObject _screenshotNotification = null; | |
public override void OnActivated (UIApplication application) | |
{ | |
// Inicia a verificação | |
if (_screenshotNotification == null) | |
{ | |
_screenshotNotification = UIApplication.Notifications.ObserveUserDidTakeScreenshot((sender, args) => | |
{ | |
Console.WriteLine("Usuario tirou foto"); | |
Console.WriteLine("Notification: {0}", args.Notification); | |
}); | |
} | |
} | |
public override void OnResignActivation (UIApplication application) | |
{ | |
// Para a notificação | |
if (_screenshotNotification != null) | |
{ | |
_screenshotNotification.Dispose(); | |
_screenshotNotification = null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment