I have used three methods but all get the same result
1.only use Network Extension to connect the VPN
2.use OpenAdapter Demo
https://github.com/ss-abramchuk/OpenVPNAdapter
3.use tunnelKit Demo
https://github.com/passepartoutvpn/tunnelkit/issues
and I had check my configuration many times ,the tunnel bundle id is correct
I just did a few steps
clone the project
2.change the App Groups and Keychain Sharing group
App IDs and Tunnel extension id and use my provisioning profile (demo-iOS,Tunnel-iOS,WireGuardTunnel-iOS)
3.modify the Configuration
4.run the project
5.set the IP address and username password
6.press connect button
and the console log always print
17:19:27 DEBUG NetworkExtensionVPN.notifyReinstall():264 - VPN did reinstall (com.bw.business.ap02-dev.Tunnel): isEnabled=true
VPNStatusDidChange: connecting
17:19:27 DEBUG NetworkExtensionVPN.notifyStatus():278 - VPN status did change (com.bw.business.ap02-dev.Tunnel): isEnabled=true, status=2
VPNStatusDidChange: disconnecting
17:19:28 DEBUG NetworkExtensionVPN.notifyStatus():278 - VPN status did change (com.bw.business.ap02-dev.Tunnel): isEnabled=true, status=5
VPNStatusDidChange: disconnected
even other methods always
connecting => disconnecting = disconnected
please help me
I faced with the similar issue and I've found that tunnel ID must match the bundle ID of your network extension
Example:
if extension bundle ID is "com.company.vpn-tunnel"
then
let protocolConfiguration = NETunnelProviderProtocol()
protocolConfiguration.providerBundleIdentifier = "com.company.vpn-tunnel"
protocolConfiguration.serverAddress = ...
For TunnelKit:
let vpn: NetworkExtensionVPN = NetworkExtensionVPN()
...
try await vpn.reconnect("com.company.vpn-tunnel", configuration: ...)
I've created an android application using Xamarin.android that consumes an asmx webservice.the latter connects my app to sql server. the app works perfectly with good internet connection. but when I have bad internet service, I get an exception in visual studio (while deploying my app to a physical device). the exception is: System.Reflection.TargetInvocationException. and when my phone is not connected to my laptop and I run the app with poor connection, my phone gets out from the app. I am trying to catch this exception so that the app doesn't crash and at least give me an alert dialog that my connection failed so I did this:
WSitems.WebService1 ws = new WSitems.WebService1();
try
{
ws.itemsinfoAsync();
ws.itemsinfoCompleted += Ws_itemsinfoCompleted;
}
catch(Exception exp )
{
Context context = this.Context;
AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.SetTitle("Connection to Server failed");
alert.SetMessage("Please, check your internet connection!");
alert.SetPositiveButton("okay",( senderAlert, args) => {
alert.Dispose();
});
_dialog = alert.Create();
_dialog.Show();
}
but the problem wasn't solved. what should I do?
thanks in advance.
I am developing a PWA that requires Push-Notifications. Sadly IOS/Safari does not support https://w3c.github.io/push-api/#pushmanager-interface for now, so I think i might have to wrap a native APP around in some way.
In Android (before their "Trusted Web Activities" was a thing) you could use a WebView to basically display a headless Chrome-View in your App. Whats the equivalent in IOS and how does the interaction between push-notifications and the Webapp (the browser need to jump to a specific page) work?
One more thing I need is integration with our companys Mobile Device Management, which is Microsoft Intune. Having integrated MDMs in Android in the past i Know that this might be a major pain in the a**, so i'm considering to build the wrapper myself, for maximum flexibility. Another option would be something like Ionic, not sure now.
This may not necessarily work in your situation, but I had the exact same issue with a PWA for Safari and I solved it by just using long polling. It will allow you to get around all of the limitations with Safari and I was able to redirect and load sections within our SPA.
async function subscribe() {
let response = await fetch("/subscribe");
if (response.status == 502) {
// Status 502 is a connection timeout error,
// may happen when the connection was pending for too long,
// and the remote server or a proxy closed it
// let's reconnect
await subscribe();
} else if (response.status != 200) {
// An error - let's show it
showMessage(response.statusText);
// Reconnect in one second
await new Promise(resolve => setTimeout(resolve, 1000));
await subscribe();
} else {
// Get and show the message
let message = await response.text();
showMessage(message);
// Call subscribe() again to get the next message
await subscribe();
}
}
subscribe();
https://javascript.info/long-polling
My app uses Location Manager to get location updates. On Samsung etc. it works fine but not for all Huawei P20 users. With this code
locationMgr.RequestLocationUpdates (LocationManager.GpsProvider, 2000, 1, this);
...
public void OnLocationChanged(Android.Locations.Location location)
{
Console.WriteLine("Location changed update: {0} provider, {1} accuracy", location.Provider, location.Accuracy);
...
...the OnLocationChanged method will in certain scenarios return "network" as provider even though I've specified "gps".
My test P20 device has the option to set "best location" in the device settings. If turned off, I get "gps" as provider with good accuracy but with the setting turned on I only get "network" with bad accuracy. Is this a bug in my code, xamarins implementation, android or Huaweis android implementation. Is there a way to force to only get "gps"?
I'm trying to automate a zipcode input field which popup a num keyboard for user input.
Appium could input the zipcode properly, but facing a problem when folding the keyboard, I notice there's appium menthod driver.hidekeyboard()
But unfortunately it's gives error when I using it.
Webdriver error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: [object Object]
Appium Server log:
debug] [JSONWP Proxy] Matched '/element/undefined/click' to command name 'click'
[debug] [JSONWP Proxy] Proxying [POST /element/undefined/click] to [POST http://localhost:8100/session/83293E4F-4B7A-462A-B5B1-1D729D54E36B/element/undefined/click] with body: {}
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[debug] [JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"83293E4F-4B7A-462A-B5B1-1D729D54E36B","status":13}
[JSONWP Proxy] Got an unexpected response: {"value":{},"sessionId":"83293E4F-4B7A-462A-B5B1-1D729D54E36B","status":13}
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[debug] [W3C (bac0efb8)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: [object Object]
[debug] [W3C (bac0efb8)] at errorFromMJSONWPStatusCode (/usr/local/lib/node_modules/appium/node_modules/_appium-base-driver#3.14.0#appium-base-driver/lib/protocol/errors.js:789:10)
[debug] [W3C (bac0efb8)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/_appium-base-driver#3.14.0#appium-base-driver/lib/protocol/errors.js:683:14)
[debug] [W3C (bac0efb8)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/_appium-base-driver#3.14.0#appium-base-driver/lib/jsonwp-proxy/proxy.js:234:19)
[HTTP] <-- POST /wd/hub/session/bac0efb8-601a-4558-a50c-f909f2ccb25a/appium/device/hide_keyboard 500 1
I also noticed there's a override method for keyboard with parameters as:
https://github.com/appium/java-client/blob/1991a8a0f9e4a3ff467dbb713cb5c51c8edc060f/src/main/java/io/appium/java_client/HidesKeyboardWithKeyName.java
driver.hideKeyboard(HideKeyboardStrategy.PRESS_KEY, "Done");
But regardless that I've imported the necessary class, it still says 'The method hideKeyboard() in the type HidesKeyboard is not applicable for the arguments (String, String)'
Anyone could help on any of the above 2 issues?
Many Thanks!
The Appium method hideKeyboard() is known to be unstable when used on iPhone devices, as listed in Appium’s currently known open issues. Using this method for an iOS device may cause the Appium script to hang. Appium identifies that the problem is because - "There is no automation hook for hiding the keyboard,...rather than using this method, to think about how a user would hide the keyboard in your app, and tell Appium to do that instead (swipe, tap on a certain coordinate, etc…)"
Workaround: Following the advice of the Appium documentation - use Appium to automate the action that a user would use to hide the keyboard. For example, use the swipe method to hide the keyboard if the application defines this action, or if the application defines a "hide-KB" button, automate clicking on this button.
The other workaround is to use sendkey() without clicking on the text input field.
The Appium method hideKeyboard() is known to be unstable when used on iPhone devices, as listed in Appium’s currently known open issues. Using this method for an iOS device may cause the Appium script to hang. Appium identifies that the problem is because - "There is no automation hook for hiding the keyboard,...rather than using this method, to think about how a user would hide the keyboard in your app, and tell Appium to do that instead (swipe, tap on a certain coordinate, etc..
If you want to hide the keyboard, you can write a function like below
public void typeAndEnter(MobileElement mobileElement, String keyword) {
LOGGER.info(String.format("Typing %s ...",keyword));
mobileElement.sendKeys(keyword, Keys.ENTER);
}
Hope this helps
You can also simply use
driver.navigate().back(); (for the older version of appium)
The problem is trying to hide the keyboard on the first place.
Set DesiredCapabilities as
cap.setCapability("connectHardwareKeyboard", false);
This will keep the keyboard hidden by default.
Do your operation of entering data by sendKeys()
appDriver.findElementByXPath("//XCUIElementTypeOther[#name=\"Confirm password\"]/XCUIElementTypeSecureTextField").sendKeys(confirmPassword);
once done call
appDriver.hideKeyboard();
and the keyboard goes away. Hope this helps
You define the capabilities like this.
desiredCapabilities.setCapability("unicodeKeyboard", true);
desiredCapabilities.setCapability("resetKeyboard", true);
If you're using Android u can use adb to hide the keyboard , send adb command from your code
adb shell input keyevent 111
If you are using android, use the below method.
If keyboard is visible (by id)
driver.pressKeyCode(4); //Android back button
else
logger keyboard is not active
Above method will dismiss the keyboard by invoking system back button.
Best solution for this problem is, just add capability in your program.
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "uiautomator2");
public void clickAfterFindingElement(By by) {
try {
getDriver().waitForCondition(ExpectedConditions.elementToBeClickable(by));
getDriver().findElement(by).click();
} catch (NoSuchElementException | TimeoutException e) {
swipeUp();
getDriver().findElement(by).click();
}
}
public void hideKeyBoard() {
if (isKeyboardShown()) {
if (isConfigurationIOS()) {
try {
clickAfterFindingElement(By.id("keyboard_done_btn"));
} catch (Exception e) {
try {
getDriver().click(By.id("Done"));
} catch (Exception e1) {
//noop
}
}
} else {
((AndroidDriver) getDriver().getAppiumDriver()).pressKey(new KeyEvent(AndroidKey.BACK));
}
}
}
This solution has been incredibly stable for us for hiding a keyboard on simulators and emulators
I'm testing a React Native app in a iPad simulator via Appium and WebdriverIO.
import { remote } from 'webdriverio';
client = await remote(opts);
I eventually found doing two actions in a row worked reliably, but one doesn't e.g.
await client.hideKeyboard('tapOut')
await client.hideKeyboard('tapOut')
I also agree with Mat Lavin's comment on the accepted answer that sending '\n' is reliable too.
await client.sendKeys(["\n"])
I also found using no param or "default" caused the keyboard to become kind of minimised to a bar which then couldn't be used until reboot.