I am currently facing an issue specifically on Android with Capacitor: The initial loading time of the app is over 30 seconds long. A white screen is shown for a long time, before the app is loaded.
I do not use any splash screen and the issue does not occur on iOS either.
Care to explain more? Using local builds have been very successful for basically everyone, and anything that stands out is likely a small config fix.
for external libraries that use cookies…remote vs local wouldn’t affect that. Besides, cookies are also not useful as ios/chrome will likely block third-party cookies.
Thank you! I am currently facing the issue that “Cookies” are generally not set on a local build version. Both in terms of the API, as well as any libraries.
I have CORS set up and can also send requests to the backend and get the correct responses.
Cookies are simply not stored in the WebView. The “Remote version” works without problems in this regard. Although, of course, WebView is also used.
It also doesn’t matter if I use Axios or community-http. After all, external libraries usually use Axios or Fetch. That means that this must also work for the local build version.
I have tested several things and nothing seems to be working.
The cookie problem has to do with cross-domain requests. It isn’t worth fighting it, we’ve tried.
For session ids, we put it in the url as a query parameter. All other storage goes either in localStorage or sessionStorage (or secure storage using a plugin).
But with built in methods this problem could be possibly solved, for example Angular Http Client. I read the following article about this.
However, when you intend to have also a website beside your apps, you would of course go for something like Axios. These requestes will not work, also from my experience so far.
In my view, this is a design flaw in Capacitor.
You can only use Capacitor if you only want to provide apps, and accordingly align the HTTP infrastructure only to them. Or you write the requests all twice, which is a lot of work and also error-prone.
The only solution for having “Website & App”, like you would nowadays usually want to have, is to point to a server. However, this is not recommended in the documentation, and obviously does not work too stable.
If you want a website and app to point to a server, you should be building a PWA for mobile. The whole point of Capacitor is to build a hybrid mobile app that runs on and is served from the device, thus feeling like a native app, while of course still allowing you to access remote API servers.
Nevertheless, the access to API servers is not that helpful considering that many libraries also require Cookies to be set, beside the most crucial “Authentication”. This is currently not possible with a local build, but only in the “PWA” mode when pointing to a server, which serves the whole app.