PWA not always updating properly - progressive-web-apps

I am working on a Vuejs PWA and I have some issues updating it when a new version is relesed.
The process my app follows is quite standard:
Detect a new version
Tell the service worker to call the skipWaiting method
Call skipWaiting from the service worker
Reload the app via window.location.reload()
All these steps work fine, and "most of the time" (>90%) when the app restarts it has the newly released code new but "sometimes" it will mysteriously still contain the old code...
Despite the facts that the skipWaiting method is properly called.
I have done a lot of testing but I have not been able to make it reproducible. It used to happen a lot on iOS but I have not seen in a while after some iOS updates (the code managing the update has not been changed meanwhile) but otherwise it happens randomly in the other browsers I have tried.
Is there something more my app should do before reloading?

Related

How to deactivate an app once in production - can code be added?

After a tiring 3.5 months I learned how to build and launch an app using Flutter and Android Studio. I tested in debug mode on various emulators and all worked well.
I then built the app bundle and uploaded on to Google Play Store as an internal release - again everything ran well.
I pushed this in to Production. After a week of waiting for a review, the app launched. I uninstalled the test version and installed the live production version - and that's when the problems started. The app began to crash in places it hadn't before. Namely on certain pages (and often after the render of certain pages the app closes after c.3 seconds) or upon button presses on certain pages.
I have now added Crashlytics to the app (which I didn't have before), and have pushed this as a second version on to the Google Play Store - and again it's pending review. The questions I have are:
Can I deactivate an app once it's live on the app store to prevent any more downloads? - Is there any code that can be added to the app to do this internally? I can not see any options or instructions within the Play Store. It seems a little crazy that I now know my app has 'bugs' which never materalised in test, but i can't 'switch it off'?
I have only been able to add Crashlytics this time for a new production release, and once installed and I can try and work out what the problem is with error logs. Once I have I will have to create a third version and again add as a new release and wait for Google to approve - is this really the most efficient way?
Why would or could a Production release of an app crash when the Debug version, or Production release version in Internal Test mode, did not? - I find it so strange that I have so many tools available and yet none detected a problem until launch
Thanks in advance!
you can unpublish your app from playstore
goto console>select your app>setup>advanced setting>unpublish app
this will stop your app from appearing to new users and getting new download from
playstore
2.fixing bugs always need a new release to update your app there is no way to get around
uploading a new release and waiting for the review to end (this is for production app)
3.your testing might not have encountered any bugs because you might be testing on one
device or emulator with a specific api for example api 30 ,and the bugs are being
detected on other apis or device properties you haven't covered in your testing

Does an iOS app continue to run in the background after an App Store update?

For example: would a VOIP app, which has an open socket which is notified of incoming traffic before the App Store update, have a chance to re-establish that socket after an App Store update? Or does the App have to wait for the user to open the App first? I can't find any answer to this in any Apple documentation.
I believe that the app is shut down (terminated) before updating, and I don't believe that the system automatically restarts them after updating (geofencing and related tasks should still work, though).
Think about it: when you get an update for Bob's Awesome Application on your desktop, you have to shutdown the app before installing the update.
After the update is installed, Bob's Awesome Application doesn't restart itself - that would just be weird - and quite annoying.

Control iPhone app getting updated when connected to old webservices

We are looking to develop an iPhone App communicating to webservices that is hosted internally at the customer site. Note that this is our first iPhone native App and using monotouch to do the job.
We will be maintaining the code and release updates periodically. However, the users needs to update only the version required based on thier local webservices and backend processes. For example, if the user is still using the version 1 webservice don't need to update the App at all, where as the users with version 2 needs to update to the matching App and so on.
We want to control the updating process or at least find a solution where if the user updates to the latest App, it won't come up with an error because the connected webservice is out of date.
We were thinking of the following processes, but nothing seems to be solving the issue.
1) Leave the app on the appstore but control the update processes somehow based on the webservices version. So when a user try to update, it will not update unless the required webservices is available. (Annoying part on this is users may be prompt that there is an update available even though those are irrelavent for them.)
2) Control the update outside the AppStore. Something similar to In-house development.
3) Stop the updating process entirely from the client, and only trigger the updates from the webservices end.
i.e Inform the client that it needs to update when the webservices updated, and the client will run the update process at that point.
However, it could be tricky, if the customer's updated to the webservices version that is not the latest.
1) There is no way to do what you want to do with Apple's AppStore, either an app can be updated or it can not, you can't add additional conditions that requires running code on the device itself.
2) That leaves in-house enterprise deployment - but this is restricted to deploying to your own company, you can't deploy to different clients this way.
3) You can't stop updates from your app, since you can't run code when an app is updated.
There is a 4), but it requires more work on your end:
4) Have your app support support older webservices, either through some sort of configuration the user can set or it query the web service for its version and selects accordingly. This has the additional advantage that an update can be deployed to all the devices first, and once all the devices have been updated, update the web service.
I would propose a fourth option: dont control/limit updating :)
Ship an app that uses a Wrapper object to access the service and that object internally handles different versions of the webservice.
apart from that.
1) doesnt work (if I get what you're doing: trying to influence the appstore updating)
2) sounds doable, and if you dont care for the appstore, it works
3) why? users love updates :) + there will be critical bugs

cordova/phonegap 1.6 crash at second launch

i use xcode 4.3.2 with phonegap 1.6. my app runs well the first time, but if i close the app in the ios simulator and i launch it for the second time, it crashes. Why?
This is probably only in the simulator. I have had it a couple of times in the simulator but it never happened to me on-device.
I am currently having this issue, except in Android. This is with the release flag. More info can be found here: https://forum.ionicframework.com/t/v2-android-second-app-start-doesnt-work-for-release-version/125583
but here is a copy pasta in case the link goes down:
Synopsis:
My app has a canvas on it on the page html. On second start of initial install, app start doesn’t show canvas. I know because the body tag has a background and the canvas has a different background. The page does not have a module defined for it. This is only when built with --release
Environment:
Ionic: 3.20
Cordova: 7.1.0
Angular: 5.2.9
Android: 6.1.2 (I think build target 25)
jdk: 1.8
Additional Info:
I am sort of doing bleeding edge stuff, but I am now out of the realm of being able to solve this on my own. I am using pixi.js, specifically from an additional interface library called angular2pixi. A2p doesn’t support --aot building.
Before I go on, let me reiterate everything works, even on multiple app restarts for everything other than --release.
The top level architecture is fairly simple:
a2p provides a service that has an instance of pixi. My app uses that service and has a page with a canvas awaiting Pixi’s rendering. When the app initializes, it starts up the pixi service, passing it the canvas reference and voila: html5ified angular.
I have offloaded the actual initialization of the rendering to a user clicked button to make sure it’s not something to do with life cycles but that didn’t work either. Even more interestingly, the button I made didn’t show when the app didn’t load. So likely, this means the ion-content itself isn’t showing!
Most interestingly, if I go into app info and delete storage (not cache) then it works on next app start! I am using localstorage but I attempted removing all mentions of it and no luck. ALSO On second install, or rather what would more technically be an update, the app works on every start after that.
This happens on android and I can’t seem to replicate it in iOS other than the first time I tried. Because it is a release build, it’s difficult to debug. I attempted using Ionic Pro Monitoring to no avail.
So far, my leanings are:
some type of caching causing a bug with the canvas itself
an error that is causing cordova or ionic to terminate
problem with my build process
a2p’s architecture (how could I go about debugging this given I have little knowledge of the underlying mechanics of cordova/ng2 -> native compilation?)
a cordova plugin (perhaps causing one of the above)
So as you can probably tell from my formatting, I’m somewhere between nerd heaven and hell. Such a fascinating problem… but plis halp

iPhone app crashes at the mid of running or during launch

I have an issue in my application. My iPhone application crashes at mid of running or during the application launch at times both in iPhone and simulator.
I know that memory management is not proper or is it because of some other reasons.
My application is using a web service that pulls the data and displays it in the view, the web service is working properly because i see the data coming from the web service into my app.
Can anybody suggest how to manage memory properly i.e. where i have to release the objects,what are the objects that has to be released and the objects that should not be released.
You can start by reading Apple's Memory Management Programming Guide and this article might also be helpful.
If you can provide some code that might be causing you problems, you should share it here for further assistance.
Sometimes an iPhone app crashes if you put too much code into init or applicationDidFinishLaunching. This has happened to me when I put too many download queries into applicationDidFinishLaunching and the app simply quit after a while while never showing my interface because it was simply overloaded with tasks. Try moving all the webcode into a separate selector and then calling performSelector:#selector(loadMyWebCode) withObject:nil afterDelay:1] into applicationDidFinishLaunching, then it should work.