Is there a way to know that Stage Manager (multitasking is currently enabled) in Xamarin. Forms Programmatically? - ipad

Is there a way to know that Stage Manager (multitasking is currently enabled) from Xamarin.Forms?
Is there a way to disable this programmatically
Can it be checked during application startup?

Related

What is the purpose of using autoWebview capability in Appium especially for iOS (with webviews)?

I'm automating an iOS app which is a mix of native and webview part, the problem is whenever I'm switching from native part to webview part I have to do a manual context switch from native to webview using driver.set_context("WEB_VIEW1"). Currently appium is creating problem if we I'm setting autoWebview to true.
My question is does autowebview handle the manual context switch part in iOS?
If you are testing Hybrid Apps, which are basically 100% webview, it can be inconvenient to remember to switch to using the Webview Context before every test. Sending the autoWebview capability tells appium to automatically switch to the WEBVIEW_CONTEXT as soon as the test starts. Appium also adds some additional logic for waiting until the webview has loaded, which can be a common source of errors.
You can find more information in the link below:
https://discuss.appium.io/t/what-does-the-autowebview-desired-capability-really-do/69/2

Cordova PWA application offline mode

I have made an angular + workbox application that now is converted using PWABuilder to Cordova project targeting ios platform.
Now my problem started with offline page, I want my application to work the same way it works on chrome browser with offline mode.
That is, even if I'm in offline mode, I'm able to use website and store the requests for later on.
But on IOS device, when I open application, then turn airplane mode or disconnect wifi and re-run an app a white screen appears. (Offline page support is disabled in manifest.js - I don't need Offline.html)
I have registered routing by
workbox.routing.registerNavigationRoute('/');
And then
// couple of following lines:
workbox.routing.registerRoute('regex with js,manifest...etc', networkFirstStrategy({cacheName} ...)
And the weird fact is that on ios this somehow can't be cached, or somethings different happens.
I'm waiting for any suggestions, or leads that can help me fix this behaviour.
Answer
The WebView as used by Cordova in the latest iOS (12.0.1) will not run Workbox because it doesn't support Service Workers.
Details
Cordova apps run in a WebView.
The app executes in a WebView within the native application wrapper... source
The WebView in the latest production iOS (12.0.1) only supports Service Workers within three specific contexts, which doesn't include Cordova apps.
At this time [the Service Worker API] is only available in Safari, applications that use SFSafariViewController, and web applications saved to your home screen. source
Next Steps
It may be possible to add Service Worker support via a Cordova Plugin. For example: cordova-plugin-service-worker.
In addition, you may also need to add Background Sync support as the latest Safari does not support Background Sync. For example: cordova-plugin-service-worker-background-sync.
The Workbox docs state that they provide a fallback strategy when Background Sync is not supported:
Workbox Background Sync...also implements a fallback strategy for browsers that
don't yet implement BackgroundSync. source
However, an open issue on Github shows that the fallback strategy may not work on iOS.

How to Programatically Turn on Guided Access on iPad/iOS Device?

I am currently automating an app for iPad that needs to be set in Guided Access mode to work. I'm using Java with Selenium webdriver inside Eclipse. The app is all setup and being deployed through Xcode and I can interact with it just fine with the iOS driver.
The problem is the user cannot login until the iPad is set to Guided Access mode on this app. I know you can turn it on by triple clicking the Home button very quickly but I have not found a way to do that using code inside my tests.
Is there a way to send keyevents specific to the iPad Home button OR is there a way to set Guided Access mode programatically? Maybe set it in the capabilities before the iOS driver/app launches?
I'm not aware of any way to send events to the home button (pretty sure this wouldn't be possible).
You can programmatically enable / disable guided access however, using UIAccessibilityRequestGuidedAccessSession. In order for this to work, your device must be supervised using MDM and have a profile installed that enables single app mode for your application.
More details here: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIAccessibilityRequestGuidedAccessSession

Launching a different ios app, within an app

I'm writing a basic application using xcode 5.1. One of the features I'm interested in trying to do is to launch another app or move to other part of iphone, INSIDE the app already running.
Eg. I have an app with 3 menu options, 1 and 2 do certain tasks as part of this parent app, menu option 3 launches another app that's installed on the phone. I'm not sure if this is possible?
No you can not do that. Besides the documented URL handlers, there's no way to communicate with/launch another app.
This is part of the sandbox principle of apple:
https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/TheiOSEnvironment/TheiOSEnvironment.html
What you can do is launch another app by using custom URL-Schemes
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/

How to automate actions performed on the iPhone simulator?

Right now I am automating tests for an app using UIAutomation class. But my app has certain features which, I believe, can't be tested using just UIAutomation. For example, there is a feature that if a new contact is added to the addressbook, a popup is shown in the app. To test this feature a new contact needs to be added to the address book the popup should be checked. But UIAutomation automates user actions only within the target app. Can anyone tell me how can I automate these type of actions(preferably using scripts)?
i would recommend you automate with Sikuli. its mucvh easier to record and play. also u can any kind of alerts or popups

Resources