Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result not returning any value #95

Closed
rolinger opened this issue Feb 28, 2023 · 8 comments
Closed

result not returning any value #95

rolinger opened this issue Feb 28, 2023 · 8 comments

Comments

@rolinger
Copy link

I just ran into the splash screen caching issue because I hadn't ever updated my splash screen til just this week - then came across Rambo's article and then found my way to your plugin.

However, its not working for me. After several starts my app still shows the original splash screen for about 2 seconds before being overlayed/replaced by the new splash screen. I assume after running this once, the original would be completely gone. But it remains.

if (ionic.Platform.isIOS()) {
  console.log("WIPING library CACHE") ;
  cordova.plugins.launchScreenCache.deleteLaunchScreenCache().finally((result) => {
    // returns true in the success case, false if iOS <13
    console.log(result) ;
    // rejects in an error case
  });
}

It makes it into conditional statement, but when printing the result its a blank value...i was expecting a false or at least some object, but nothing is coming back.

@timbru31
Copy link
Owner

Thanks for your issue, I'll check this.
Can you try to run

await cordova.plugins.launchScreenCache.deleteLaunchScreenCache().then(console.log).catch(console.error);

to see if there is any error thrown?

Are you awaiting the Promise? (I can see that the example is missing the await)

@rolinger
Copy link
Author

Ya know, it was late last night and I just took your code verbatim and just assumed it would work. Applying a proper promise now - damn cordova build ios takes nearly 7 minutes to compile since upgrading to Cordova 11, [email protected] on the latest Xcode 14.2. Took about a minute before the upgrade. Will share in a few.

@rolinger
Copy link
Author

The following returns Cache Response: true - but I am still getting the old splash for about 2 seconds before its overlayed/replaced with the new splash.

      cordova.plugins.launchScreenCache.deleteLaunchScreenCache()
      .then(function(result) {
        console.log("Cache Response:" +result) ;
      }).catch(function(err){
        console.log("Cache Error: "+err) ;
      }) ;

@rolinger
Copy link
Author

I have combed through all my Images.xcassets and CDVLaunchSreen.storyboard and there are no images of the old splash to be found anywhere.

@timbru31
Copy link
Owner

What iOS version are you testing? It could be the case that Apple changed something again and made things worse 👎

@rolinger
Copy link
Author

rolinger commented Feb 28, 2023

iPhone 7,
ios 15.7.3, but app is running Cordova 11, [email protected]

Its happening on Simulator too, iPhone 14, ios 16.2. I am noticing that when connected to mac and app is launched from Xcode, I see the old splashscreen showing and its replace after a few lines of Xcode console output showing the app loading. Until the app load console messages start, the original splashscreen is showing. Able to confirm on a few simulators - sometimes the app launches and it takes a good 10+ seconds to start loading the app, the old splash shows the entire 10 seconds - then as the console messages start the splash is replaced with the new one. So def a caching issue.

@rolinger
Copy link
Author

Correction....it IS working on Simulator. I was testing different devices on initial startup (that already had app on it), it showed the old splash screen on first start up, but on subsequent start ups it was ONLY the new splash screen.

So its something specific to physical devices.

@timbru31
Copy link
Owner

Yes, that's expected as the cleanup code can only run after the splash was displayed - but it will fix it for subsequent launches (as Apple fails to clean the cache on it's own...). In the past when we did a big rebranding we ran the code in our migration script that was part of the update and the user saw the old one just once.

I'll close this issue for now, please re-open if you encounter further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants