How to handle window visibility when in recent apps view - flutter

I want to hide the app preview of a single specific screen in recent apps when the user leaves the app. Like if the user is on a secure payments page but pressed recent apps or changes the app to another one then the preview we get in-app switcher (or recent apps) should be hidden.
The Visibility widget only visibility widgets of the app.

As suggested by Akora Ing. DKB, we have to write platform code to disable previews & screenshots for a specific platform. (Reference video)
For Android, we have to add getWindow().addFlags(LayoutParams.FLAG_SECURE) for flutter activity. This disables previews & screenshots for the whole flutter view. To only disable a single screen we'll need another flutter activity.
I don't know about iOS but on Android, we can create multiple flutter activities. Problem is, the FlutterActivity will automatically start the main Dart entry-point. So if we want to use a different entrypoint we would have to duplicate the FlutterActivity and give it a custom Delegate which starts the other entry-point in its onCreate().
I'm sure this answer would not be completely right, but it would be helpful for someone.

Related

Can we change an apps icon from inside the app?

Is there a way I can have an in-app option to change its icon ?
I am trying to build a bootstrapped app builder/generator, where you can rename the app, set its icon and color styles from within the app. Is this even possible ?
My question is specific to a Flutter approach that will work for both Android and iOS. Would this be possible ? if yes, then a library has to be made.

How to remove Accessibility shortcut option from my Accessibility app?

I have an AccessibilityService that will break if the user turns it on and off through the Android system user interface. I only want the user to be able to disable/enable AccessibilityService through my own Activity which will handle shutting it on and off correctly.
I never encountered this feature before until I tested my app on newer devices. On Android 11 devices there is suddenly an option to toggle "Accessibility Shortcut". This will add a button at the bottom corner the navigation buttons OR it will allow the user to toggle the AccessibilityService by holding both volume buttons at the same time. For my app, it say's it will add the toggle near the navigation buttons.
How do I remove this option?
I am running into the exact same problems. Users tend to enable all switch button they see without reading explanation or videos. Since accessibility shortcut interfere in a bad way with the accessibility service, they got a non working experience.
It seems at first sight there is no option for developpers to hide the option for their accesibility services...

How to use Flutter to implement a button like ios virtual home button

I want to create a button can move to any position like iPhone Style (Virtual Home Button) in Flutter but I don't know any packages or any library can do it. Moreover, I'd like the button to be able to show along with a specific app, eg. dial-up UI. If I deploy to desktop, will its behavior the same with mobile?
ios virtual home button
show button along with dial-up UI
Hope you guys help me ways to create it.
I have tried with unicorndial, floating_bubble, popup window, etc.
but all of them are widget within flutter app, instead of system-wide.
Sorry you can't really create anything like that outside of your App context. Apple is very strict in situations like this.
You can implement this sort of feature in Android by using Floating Service. But for Apple it's a NO NO.

Accessing elements of webview within a native iPhone app using UI Automation

I am working on UI test automation using Apple's UIAutomation framework for a native iPhone app that uses web views for its checkout transactions. The problem I am facing is that when I tap on Checkout button from the native app, a webview within the app opens up which has a button named 'Complete Checkout' that I am not able to access. I have tried using target.logElemenTree() to get the elements of the WebView, but I do not get to see anything in Instruments. Can anybody let me know how to access webview elements within the native app on iOS?
You can get the X,Y coordinates of the Complete Checkout button and have UI Automation tap it. For example, if the X,Y coordinates of the button are x:10, y:20 you would run target.tap({x:10, y:20});
If your checkout button is a link inside a webview then you will be able to access it.
check the property of the "complete checkout". Tapping using X and Y co-ordinates is not a recommended option.

how do you pop up the Save Image/Open in New Page/Copy menu on command in mobile safari?

I need to find out how to make the menu that appears in mobile safari on the iphone/touch when you tap & hold an element appear on a single tap without having to hold. how would i do this? preferably i would use webkit & no js.
UIWebView does not does not call any methods until a link is actually activated, and it does not expose any information about its subviews. There is no way to do with current SDK, you should file a bug with Apple if you need this functionality.