With no connection (and entering the correct login credentials) I'm getting the no connection alert AND incorrect password alert upon button click.
I want to disable the incorrect password alert on button click if offline.
With no connection (and entering the correct login credentials) I'm getting the no connection alert AND incorrect password alert upon button click.
I want to disable the incorrect password alert on button click if offline.
This did not work.
The offline doesn't clear from localStorage. If I turn my device's connection off then back on, I still get my "no connection" alert on login button click--regardless of correct login info or not.
I've shared the app "Digest of Tech..." with you guys if you wouldn't mind taking a look to see what I'm missing. These are my goals:
IF CONNECTED:
I want an "incorrect login" alert to fire on button click if incorrect credentials entered.
IF NOT CONNECTED:
I want a "no connection" alert to fire on page load AND on login button click (NOT "incorrect login" alert).
Thanks
Hello Mike,
Set value of LSV as "offline" JavaScript event Run:
codelocalStorage.setItem ("offline", "true"); /code
Leave only Run for click for Login button. JavaScript with this code (remove the call to the service):
codefunction callBackFunctionB(){
console.log('OK');
}
if ("offline" in localStorage){
navigator.notification.alert(
"Your device has no connectivity",
callBackFunctionB,
'Connection Required'
);
} else {
login.execute({});
} /code
You guys are the best
I have tried running the navigator.notification.alert JS on a click of a label and am not getting any response when testing on the Appery mobile tester (iOS). Any ideas as to why this is?
Hi Mike,
This is because Appery.io tester opens applications as web apps, while navigator.notification.alert works for native applications only. Just install the app on device to make it work.
navigator.notification.alert works fine on a button click in the Appery mobile tester.
I installed the app on the device as well and got no response on a click of a label.
I changed the JS to fire on a Virtual Click instead of a Click and now it's working.
In testing this some more I've come across another issue.
If I disable my connection THEN run the app, I correctly get the "no connection" alert when I attempt to login.
If I CLOSE the app, THEN re-enable the connection, and THEN run the app again, I still get the "no connection" alert upon a login attempt--regardless of entering the correct credentials or not.
However, if I keep the app running while I toggle the connection on/off, everything functions correctly.
Mike,
Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a, tell its name and steps to test this behavior.
Also please specify your device and its OS version.