You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/08/18 15:16:15 UTC

[GitHub] [cordova-android] fquirin commented on issue #1463: navigator.splashscreen.hide() issue in cordova-android v11.0.0 when AutoHideSplashScreen is true/false

fquirin commented on issue #1463:
URL: https://github.com/apache/cordova-android/issues/1463#issuecomment-1219619306

   So, I did some digging and built the "Hello World" app from scratch 🙂:
   
   ```
   sudo npm install -g cordova@11.0.0
   cordova create hello com.example.hello HelloWorld
   cd hello
   cordova platform add android@11.0.0
   ```
   
   After setting up the config and adding the hide function to the device-ready event as seen above **it was indeed working** if `AutoHideSplashScreen` is `false`! 
   
   Then I asked myself what is the difference to my "real" app, installed a dozen plugins and ... it was still working 😅 .
   Finally I reviewed my initial code and remembered this in my `onDeviceReady` function: `cordova.InAppBrowser.open("index.html", "_self");`. It is a redirect to my actual starting-page (my default is start.html) and for a reason I can't remember I decided years ago to use the `InAppBrowser.open` to do it.
   After that `navigator.splashscreen.hide()` is broken when called in the new `onDeviceReady` or anywhere else in my app.
   
   When I replace `cordova.InAppBrowser.open("index.html", "_self");` with `window.location.href = "index.html";` it miraculously starts working again! The old version of splash-screen didn't really care so the code worked fine for the last ~3-4 years 🤷‍♂️ .
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org