Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

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

Open
Menardi opened this issue Dec 16, 2018 · 0 comments
Open

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

Menardi opened this issue Dec 16, 2018 · 0 comments

Comments

@Menardi
Copy link
Collaborator

Menardi commented Dec 16, 2018

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

  • Create a new Cordova app with cordova-ios
  • Create a zip file with an image in it
  • Download this zip file using this plugin, and save data.localPath in the completion handler
  • Use this saved path to display the image in app
  • Bump the version of the app in config.xml (e.g. from 0.0.1 to 0.0.2), and re-run the app
  • The image no longer displays, as the path is no longer valid

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

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

No branches or pull requests

1 participant