phonegap / phonegap-plugin-contentsync

Download and cache remotely hosted content
Apache License 2.0
206 stars 98 forks source link

Path to downloaded content is no longer valid after app update #198

Open Menardi opened 5 years ago

Menardi commented 5 years ago

Expected Behaviour

The path returned in the completion handler (data.localPath) will always point to the downloaded data, across app updates.

Actual Behaviour

When the app is updated, it seems that iOS assigns the app a new UUID. Since the path returned in the completion handler is based on the UUID, it is no longer valid.

For now, my workaround has been to use cordova-plugin-file to determine the path dynamically (cordova.file.dataDirectory with the name of the zip's folder added).

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 12.1.1

Cordova CLI version and cordova platform version

cordova 8.1.2 cordova-ios 4.5.4

Plugin version

1.4.2