Hello everybody,
I really need help with iOS emulated mobile App (Bootstrap5 + Capacitor).
My app works with Browser and Android.
I decided to build a new test app with Bootstrap5 + Capacitor to test my login process with iOS.
The Test app includes an index.html page (view) + a home.html page
The home.html page contains 3 containers:
1- a login form
2- a display container (displayind user_id / name)
3- a log-out button
(I previously used a redirect to login/home based on id… with the same failed result for iOS)
I displayed 1rst or 2nd container when user is logged-in or not.
The login action returns the identity result. Add local storage in your index.html page, then add a variable that will store the user id, then on login success set the local store variable to the loginform.data.identity
I just built a quick capacitor app from scratch and adding this to capacitor.config.json made possible in ios sim for a server connect to properly return the identity after an earlier login:
"server": {
"hostname": "your-server-domain"
}
Have to run now, but can try on device a bit later.
i havent tried this though but it looks like it might solve the problem. They recommend it to keep it as localhost in their documentation because other web apis depends on it, i think thats why cookies are set when testing on local server for ios but on remote server it doesn’t work
server?: {
/**
* Configure the local hostname of the device.
*
* It is recommended to keep this as `localhost` as it allows the use of
* Web APIs that would otherwise require a [secure
* context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts)
* such as
* [`navigator.geolocation`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation)
* and
* [`MediaDevices.getUserMedia`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia).
*
* @since 1.0.0
* @default localhost
*/
hostname?: string;
Just tried this but it won’t let me load any server connect actions with the this setting. Is there anything else you need to do after this or literally just add it and run?
Hi,
I was working on these workaround for iOS login and did a MacOS update. Since I can’t access my debug console both with Chrome inspector for Android Mobile App version and Safari for the iOS app version.
Does anybody know how to re-activate? Very complicated to test devs without the debug console.
Hi,
I was working on backend web part of the project these last days. But still can’t open both inspector with Chrome neither Safari… (and this is a big issue to achieve my devs with mobile phone).
I did not succeed with cookie on iOS. I planned trying @Adetoyinbo1 solution this afternoon. I have some bugs to fix before.