简体   繁体   中英

How do I disable screen mirroring for Flutter app?

I'm working on a new flutter app and the client wants to detect screen mirroring and disable it, Is there is a way to do so in Flutter using a third party package or something?

I've tried using the FLAG_SECURE in android but it disables only screenshots not screen mirroring.

There is no out of the box package for flutter. And there is also no effective way to disable mirroring for Android and iOS.

What you can do on Android is to use the DisplayManager to get all current logical displays with the method getDisplays . Then you can maybe show a pop up if the number of displays is to big for your app, in order to inform the user.

For iOS I don't think there is something available to stop or at least detect screen mirroring.

for android side we can use

int CanMirror = Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);

you can get better idea : https://stackoverflow.com/a/63971764/18340828

and ios side dont have much idea.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM