Closed BSTomack closed 4 years ago
I see now that my "../" version writes the SwiftSecureApplicationPlugin.swift like this:
public func applicationWillResignActive(_ application: UIApplication) {
self.registerBackgroundTask()
UIApplication.shared.ignoreSnapshotOnNextApplicationLaunch()
if let window = UIApplication.shared.windows.filter({ (w) -> Bool in
return w.isHidden == false
}).first {
if let existingView = window.viewWithTag(99699), let existingBlurrView = window.viewWithTag(99698) {
window.bringSubviewToFront(existingView)
window.bringSubviewToFront(existingBlurrView)
return
} else {
...
where as my "secure_application: ^3.5.3" version writes it like this:
public func applicationWillResignActive(_ application: UIApplication) {
if ( secured ) {
self.registerBackgroundTask()
UIApplication.shared.ignoreSnapshotOnNextApplicationLaunch()
if let window = UIApplication.shared.windows.filter({ (w) -> Bool in
return w.isHidden == false
}).first {
if let existingView = window.viewWithTag(99699), let existingBlurrView = window.viewWithTag(99698) {
window.bringSubviewToFront(existingView)
window.bringSubviewToFront(existingBlurrView)
return
} else {
...
I tried this:
return MaterialApp(
home: SecureApplication(
nativeRemoveDelay: 1000,
secureApplicationController: SecureApplicationController(
SecureApplicationState(
locked: false,
secured: true,
paused: false,
authenticated: false,
),
),
child: MainBody(),
),
);
but had no luck. What do you do to set secured to default to true?
Nevermind...
Widget build(BuildContext context) {
return MaterialApp(
home: SecureApplication(
nativeRemoveDelay: 1000,
child: Builder(builder: (context) {
SecureApplicationProvider.of(context).secure();
return MainBody();
}),
),
);
}
You were too fast for me to even see the initial question! Glad you sorted it out!
Your code is great! Thank you!
I've tried playing around with this package and ran into a problem getting it to work. I reduced your example to the most basic structure: main.dart:
} main_body.dart:
} When I changed the dependency from:
to the prescibed:
The blur no longer worked when the app was minimized. I've tried this with a few different configuration and always get the same result. Can you provide any insight into what's going on?