I'm Using Angular service worker for offline caching, Most of the time the app will be used in offline mode only, so on initial app launch i want to display 'Application ready to use' snack bar once the caching is completed, to make sure all the background caching is completed and the application is fully ready to take offline. Is there an option to detect the caching complete process? because i couldn't find anything in the official documentation and googling also didn't help.
Related
I have an app written in js. I want to convert it to a pwa without a service worker . By adding manifest file I can add it from home screen and open it in full screen mode. Does it still using http caching If enabled or it will fetch request from network every time as I don’t have any service worker .
Secondly how can I provided updated change in manifest file to an already installed pwa in ios.
We have built an in-house Enterprise iPad2+ application that connects to a Drupal CMS, where content (text/images/video) is being delivered to the app via a REST API.
When the user launches the app for the first time, they are prompted to download the content over WIFI network. We are experiencing content failing to download inconsistently i.e. sometimes 60 images fail to download; other times 20 images fail. Since we've added video into the download mix, the content is failing even more often.
Server details:
Windows server
IIS7.5
PHP 5.3
MYSQL5.1
App details:
Require.js: provides JavaScript file and module loading
Backbone.js: provides a frontend JavaScript application framework
Cordova (v2.7.0): Used to provide an environment to run on iOS
Raphael.js: For procedural graphics and animations
jQuery and plugins: For Dom manipulation, animations and interactions
Bootstrap: Base framework for HTML mark-up
Download process is as follows:
User launches app and is prompted to download content
Download begins
The app now makes AJAX call to REST API to fetch content
Upon a successful fetch, the REST API delivers an array of content (text/images/video) - max video filesize 11mb
Content is delivered synchronously
We can add logic to keep retrying upon failure, but this could result in an indefinite loop. The content download size is approx. 50mb, over WIFI.
Our testing:
We have tried from 3 different locations in the world: SA, UK and US and similar issues.
We've tested a 300mb download from the same server, on the same iPad and it downloads fine
QUESTION:
Can anyone tell us why this would be failing?
Could the problem be with a Drupal configuration issue we're missing?
UPDATE 25 August:
We have done some more research and it seems the problem may be a result of iOS Safari timing out at 60secs, and then everything fails after that that to download - see here: http://www.sencha.com/forum/showthread.php?111231-iOS-Safari-Mobile-AJAX-timeout
Has anyone else come across this issue?
We have tried downloading over LAN, and that is 100% fine. WIFI is the issue.
We have tried refreshing the download script after x seconds and resetting the timeout counter. We've tried to detect if a download has failed and to continue retrying it.
Stumped at this point...
UPDATED SOLUTION 28 August:
UPDATED SOLUTION: we have fixed the problem. The issue fundamentally lies in the fact that iOS Safari times out at 60secs. Why? We have no idea... What we were doing was fetching the full list files to download, and then downloading them synchronously. What happened at 60secs, is the download times out and we were losing our file list. What we did to resolve this, is we saved the files not downloaded list at 60secs, then started the download process again with this new list, and repeated this process until all files successfully downloaded.
I have a simple web app that I want to use locally (i.e. I don't want it to ever access the network). All the code is packaged according to the Safari Web Content Guide. I was successful in downloading my web app to my iPhone. I noticed, though, that even though my web app doesn't connect to anything remotely, there will be a network access (the network access indicator fires).
I suspect that iOS is checking to see if the web app is fresh (i.e. checking the cache manifest to see if it needs to update any files). Is there a way to prevent this? It really screws up the user experience.
The never-ending network spinner is a bug in iOS; you won't be able to get around it with a web app:
http://www.devthought.com/2012/09/22/understanding-the-ios6-ajax-bugs/
I have a phonegap app and I want to execute Javascript code in a background task. When the application enters background I start executing a javascript function which takes data out of a web database and sends some values to a web service, the returning data may toggle a push-notification to the user.
I found either how to call javascript from Objective-C here on Stackoverflow and how to implement Long-Running Background Tasks in the iOS SDK Documentation pages, but I haven't found anything in combining both (what I think is e.g.: When I invoke javascript code via a webview, does this View even exist when the App is in background?) so I want to ask some more experienced iOS Developers if this is even possible.
I don't think its really possible. Javascript requires a UIwebview to run (in realtime) and must be visible to the user. When an app is put in background only a small amount of tasks are allowed to run- webview not one of them.
Your better off sending your data to a web server that runs a cron-job or similar to send out a push notification via apples push notification server - You can also bypass this and use a service like http://urbanairship.com/
I experimented with this on iOS 5+ and it's possible. I created a small PhoneGap plugin that demonstrates how this works. Check it out, and see the README for most of the info.
https://github.com/jocull/phonegap-backgroundjs
I've got a Blackberry app (5.0 and above) that I'm making changes to. One feature of the app launches an online banking function in a BrowserField2. I'm investigating a change to the app that would have the online banking function launch in the native browser, using this basic function:
Browser.getDefaultSession().displayPage(myBankingUrl);
The change is mostly motivated by performance -- the BrowserField2 seems a lot slower than the external browser.
My show-stoppper is this: in the existing implementation, I can detect when the BrowserField2 screen is shut down, and I can force the invocation of a logout call. The bank that's associated with the online banking function really really cares about this. I have not yet found any way to hook in to the shutdown of the external browser to port over this piece of functionality. Has anyone tried something like this?
There is no API to detect that. You can listen when your app is activated - if you open browser your app screen is second in stack and becomes first when user closes first. But there is no garante that user will close browser or move to another app (to view incoming sms for example).
I would suggest you to continue with BrowserField2 for 5.0+.
The browser on a BlackBerry is always running. It provides the default push service reception and other required services.