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/07/28 07:54:54 UTC

[GitHub] [cordova-android] goffioul opened a new issue, #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

goffioul opened a new issue, #1468:
URL: https://github.com/apache/cordova-android/issues/1468

   # Bug Report
   
   ## Problem
   
   Upgrading to cordova-android@11 and the new splashscreen system comes with 2 regressions in my app:
   1. Android does not seem to use the splashscreen API for home/launcher app (tested in `system-images;android-31;default;x86_64`), which result in splashscreen completely missing in my app; there is no redraw on screen until my app closes the splashscreen
   2. there is no no way to reshow the splashscreen; this is a bummer as the previous splashscreen system was a very convenient interstitial screen to use while the app was reloading
   
   To reproduce:
   1. create a new app
   2. add cordova-android@11 platform
   3. use preferences:
   ```
   <preference name="AutoHideSplashScreen" value="false" />
   <preference name="FadeSplashScreen" value="false" />
   <preference name="ShowSplashScreenSpinner" value="false" />
   <preference name="RemoveSplashScreenOnPause" value="false" />
   ```
   4. add utility button in `www/index.html`:
   ```
   <button id="splashscreen-button">Show splashscreen</button>
   ```
   5. edit `www/js/index.js`:
   ```
   function showTemporarySplashscreen() {
       navigator.splashscreen.show();
       setTimeout(() => navigator.splashscreen.hide(), 3000);
   }
   
   function onDeviceReady() {
       ...
       setTimeout(() => navigator.splashscreen.hide(), 3000);
       document.getElementById('splashscreen-button').addEventListener('click', showTemporarySplashscreen, false);
   }
   ```
   6. edit activity in `platforms/android/app/src/main/AndroidManifest.xml`:
   ```
   <category android:name="android.intent.category.HOME" />
   <category android:name="android.intent.category.DEFAULT" />
   ```
   
   
   ### What is expected to happen?
   1. splashscreen is always displayed at startup
   2. it is possible to reshow the splashscreen at runtime
   
   
   ### What does actually happen?
   When starting the app from the app drawer, the splashscreen is displayed. But when installing the app as the default launcher, killing the app, and restarting, one can see no splashscreen is displayed by Android.
   
   Also the inability to reshow the splashscreen is a real regression IMO. I understand the limitation of the new SplashScreen API, but maybe it would have been better to design the new cordova splaschreen system as a complement to the legacy system, with opt-in capability for the legacy system, instead of fully replacing the legacy system with loss of functionality.
   
   
   ### Version information
   - cordova-android@11
   - Android 12 (emulator: `system-images;android-31;default;x86_64`)
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
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.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


[GitHub] [cordova-android] goffioul commented on issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

Posted by GitBox <gi...@apache.org>.
goffioul commented on issue #1468:
URL: https://github.com/apache/cordova-android/issues/1468#issuecomment-1327305813

   If it was a bug in Android 12, then it's still there in Android 13. For a home/launcher app, launched with the HOME button, there's no splashscreen at all.


-- 
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


[GitHub] [cordova-android] breautek commented on issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1468:
URL: https://github.com/apache/cordova-android/issues/1468#issuecomment-1198295897

   > splashscreen is always displayed at startup
   
   This is enforced by Android starting with Android 12, and mimicked by the android compatibility layer for older android versions. Cordova cannot disable splashscreens.
   
   > Also the inability to reshow the splashscreen is a real regression IMO. I understand the limitation of the new SplashScreen API, but maybe it would have been better to design the new cordova splaschreen system as a complement to the legacy system, with opt-in capability for the legacy system, instead of fully replacing the legacy system with loss of functionality.
   
   The general stance the community took was it was better to support the Android splashscreen API, as it essentially enforced. That splashscreen API is definitely far more restrictive (I agree, personally I don't like it either). Reshowing the splashscreen is part of those limitations, as you noted. I don't think it's possible to reshow it because I don't think Cordova has access to that view programmatically. I think we would essentially need to rebuild the view and have it match, which I think would be rather error-prone. Do correct me if I'm wrong.
   
   > with opt-in capability for the legacy system, instead of fully replacing the legacy system with loss of functionality.
   
   The legacy system as already explained above is incompatible with the Android's splashscreen API. The best this can reach us is having 2 splashscreens (one from native android which **will** be unavoidable, and the one from the old cordova splashscreen plugin) where you can only control the splashscreen plugin's splashscreen. An example of this could be seen if you ran a cordova-android@10 app on an Android 12 device/emulator.
   
   The splashscreen plugin has been updated to not install on cordova-android@11, because they both clobbers the same namespaces and cause conflicts. Some preferences are reused, but outside of that, if similar behaviour is wanted, I suppose a workaround is to fork the splashscreen plugin, and change the namespaces / JS clobber points so that you have access to both cordova-android@11 splashscreen APIs as well as the legacy splashscreen APIs. But I don't see this being a supported feature at an Apache level.
   
   Personally in my apps, I dealt with this issue by recreating the splashscreen in the webview. Native splashscreen is sitll used for app launch, but may proceed to the webview-based splashscreen for remaining lifecycle of the app. If you're reloading the app as in `window.reload()`, then this probably won't work for you however. And this would also require a SPA-style appication.
   
   Regarding splashscreen drawing issues, there is are bugs in the android emulator surrounding drawing the splashscreen. It's noted in our [documentation](https://cordova.apache.org/docs/en/11.x/core/features/splashscreen/index.html#android).
   
   As a somewhat related side note... one of Android's largest problems is the fact that not a lot of experiences are standardised and different features work very differently across different devices which has put quite a burden to android developers in the past. It seems like Google / Android team has started putting a focus on providing a standard means of doing things in the apps. This is a personal observation of Android 12 introducing a standardised Splashscreen, and Android 13 is going to be including a standardised [Photo Picker](https://developer.android.com/about/versions/13/features#photo-picker). As Android rolls out these changes, it's going to be inevitable that their APIs won't be 100% compatible existing solutions.


-- 
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


[GitHub] [cordova-android] jcesarmobile commented on issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #1468:
URL: https://github.com/apache/cordova-android/issues/1468#issuecomment-1233502984

   As breautek explained, it's working as expected, if you want to show a different splash screen programmatically you can fork the splash screen plugin and make some changes or create your own splash plugin, but we are not going to show a splash different from the initially shown and google doesn't provide a way of getting the splash screen view, so we are not going to try to mimic it.
   
   Just a note about the "emulator bug", the docs are incorrect, it's not an emulator bug, it's an Android 12 bug and also happens on real devices, Google has fixed it for Android 13, but they won't fix it for Android 12.


-- 
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


[GitHub] [cordova-android] goffioul commented on issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

Posted by GitBox <gi...@apache.org>.
goffioul commented on issue #1468:
URL: https://github.com/apache/cordova-android/issues/1468#issuecomment-1198405448

   > The legacy system as already explained above is incompatible with the Android's splashscreen API. The best this can reach us is having 2 splashscreens (one from native android which will be unavoidable, and the one from the old cordova splashscreen plugin) where you can only control the splashscreen plugin's splashscreen. An example of this could be seen if you ran a cordova-android@10 app on an Android 12 device/emulator.
   > 
   > The splashscreen plugin has been updated to not install on cordova-android@11, because they both clobbers the same namespaces and cause conflicts. Some preferences are reused, but outside of that, if similar behaviour is wanted, I suppose a workaround is to fork the splashscreen plugin, and change the namespaces / JS clobber points so that you have access to both cordova-android@11 splashscreen APIs as well as the legacy splashscreen APIs. But I don't see this being a supported feature at an Apache level.
   
   Thanks for the extensive response. We can just agree to disagree, but I wouldn't say the legacy system is incompatible with the Android 12 spashscreen API. It could be seen as complementary. Given the limitation of that new API, I would have prefered to see cordova-android embracing the new API as a separate feature, instead of clobbering the existing legacy system and making it completely incompatible. I don't see the potential double splashscreen as a serious/blocking issue. This would have been less disruptive for app developers.
   
   > Regarding splashscreen drawing issues, there is are bugs in the android emulator surrounding drawing the splashscreen. It's noted in our [documentation](https://cordova.apache.org/docs/en/11.x/core/features/splashscreen/index.html#android).
   
   The problem I see is different than the one described in the doc. But it may still be a bug in the emulator, though.


-- 
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


[GitHub] [cordova-android] jcesarmobile closed issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

Posted by GitBox <gi...@apache.org>.
jcesarmobile closed issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen
URL: https://github.com/apache/cordova-android/issues/1468


-- 
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


[GitHub] [cordova-android] jcesarmobile commented on issue #1468: No splashscreen for home/launcher app + unable to reshow splashscreen

Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #1468:
URL: https://github.com/apache/cordova-android/issues/1468#issuecomment-1327308625

   For me the splash screen is appearing on android 13, but I only build regular apps, not launcher apps.
   If it doesn’t work there you should report it to google so maybe they fix it in a future 13.x release or 14.


-- 
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