Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.
This repository was 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

@Menardi

Description

@Menardi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions