neckaros / secure_application

Secure your application from prying eyes
MIT License
102 stars 57 forks source link

Question - is locking (and the blur effect) supposed to be automatic when going to app switcher/background? #33

Closed eggman87 closed 2 years ago

eggman87 commented 2 years ago

if I manually lock here:

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    super.didChangeAppLifecycleState(state);
    if (state == AppLifecycleState.inactive || state == AppLifecycleState.paused) {
      SecureApplicationProvider.of(context)?.lock();
    } else if (state == AppLifecycleState.resumed) {
      SecureApplicationProvider.of(context)?.unlock();
    }
  }

I get locking when opening app switcher on iOS. on Android it blurs the screen but then the blur goes away after app is in background. The docs make it seem like I should not have to manually call lock to get this to work, is that correct?

eggman87 commented 2 years ago

the sample app works fine, trying to figure out what I got in my setup that is not working.

eggman87 commented 2 years ago

Turns out you must call SecureApplicationProvider.of(context)?.secure(); first to have the blur automatically happen.