1
import Flutter
import UIKit
import NetworkExtension
import FirebaseCore
import app_links

@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    FirebaseApp.configure()
    GeneratedPluginRegistrant.register(with: self)
    self.window.makeSecure()
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }     
}
extension UIWindow {
   func makeSecure() {
       let field = UITextField()
       field.isSecureTextEntry = true
       self.addSubview(field)
       field.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
       field.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
       self.layer.superlayer?.addSublayer(field.layer)
       field.layer.sublayers?.first?.addSublayer(self.layer)
     }
   }

this code is not working on physical ios device ,i want to try native code for preventing taking screen shot & screen recording for secure data

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.