-
Notifications
You must be signed in to change notification settings - Fork 98
Full working sample #137
Comments
Yes here |
It work's finde, but when i restart the app, the old local content appears. |
@realn3rd correct. In the app start up you'd need to check if there is content at the synched location and load your app from there instead. |
Right. The plugin doesn't manage content for you. It just syncs content to store it to some permanent location. There are different ways you can manage content and it's up to you how you want to do that. |
How can I add a simple test routine to the app? |
any idea? |
@realn3rd what do you mean by simple test routine ? |
A simple way to test on app start if content were already downloaded und redirect to this content. |
Maybe something at device-ready-event? |
@realn3rd Yes you can call something when For example: document.addEventListener('deviceready', function() {
// this downloads your app if it doesn't exist OR immediately returns a path to your app if it had been previously downloaded
// the `src` option is not required if you know that your app was previously downloaded.
var sync = ContentSync({src: "...", id: "...", type: "local"});
sync.on('complete', function(data) {
// data.localpath will point to your app
});
}); |
Nice, but it doesn't work :/ |
What doesn't work ? Could you be more specific ? |
The App shows only the local content, not the cached after restarting it. |
@realn3rd did you set |
Any idea? |
@realn3rd sorry for delay. You can try to use the following (on iOS 9+ and above) if you're using WKWebView:
I've updated the sample in the repository to reflect this. |
Can anyone give an full working example for downloading, extracting und redirecting to the extracted content?
The text was updated successfully, but these errors were encountered: