neckaros / secure_application

Secure your application from prying eyes
MIT License
103 stars 61 forks source link

How to change color when in application switcher on iOS? #31

Closed minhdanh closed 2 years ago

minhdanh commented 2 years ago

On iOS whenever I open my app (with secured state), and open task switcher, the task switcher hides the content of the app with a white color. Can I change this color (my use case is that I want to support dark mode)? Thanks.

neckaros commented 2 years ago

This should not be difficult and is a good idea. The white color is set here:

https://github.com/neckaros/secure_application/blob/c87dddd4f69aa3f9fe279cf88b0c9303e7bd9d56/ios/Classes/SwiftSecureApplicationPlugin.swift#L39

            colorView.backgroundColor = UIColor(**white: 1**, alpha: opacity)

It could be set as opacity as an optional argument.
I don’t have a Mac to test. Would you be willing to test or do a PR?

minhdanh commented 2 years ago

I'm not familiar with Swift so I'm not sure how to do a PR for that :sweat_smile: But I'm willing to test a PR :+1:

minhdanh commented 2 years ago

It could be set as opacity as an optional argument.

Can you tell how to link that optional argument between Flutter (dart) and Switft? I mean, how to pass one argument from Flutter too Swift?

minhdanh commented 2 years ago

This is implemented in https://github.com/neckaros/secure_application/pull/29 I hope it will be merged. Closing this for now.