phonegap / phonegap-plugin-contentsync

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

[iOS] calling sync() with options.copyCordovaAssets set does not perform copy #188

Closed blefebvre closed 6 years ago

blefebvre commented 6 years ago

Expected Behaviour

When sync() is called with copyCordovaAssets: true, per the README I would expect the Cordova related assets (cordova.js, cordova_plugins.js and plugins/) to be copied to the sync'd directory. This works as expected on Android.

Actual Behaviour

On iOS, once sync() is called the app prints "Requesting local copy of ", but does not actually perform the copy.

None of the event handlers (complete, error, or progress in my testing) are called.

Reproduce Scenario (including but not limited to)

I've created a basic app that demonstrates this issue: https://github.com/blefebvre/phonegap-plugin-contentsync-copyCordovaAssets-bug

Steps to Reproduce

Note how the app hangs on the "Initializing..." page, and none of the Content Sync event handlers are called.

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

iOS 11

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

n/a

Cordova CLI version and cordova platform version

cordova --version                                    # 7.1.0
cordova platform version ios                     # 4.5.4

Plugin version

cordova plugin version | grep phonegap-plugin-contentsync   # 1.4.1

Sample Code that illustrates the problem

https://github.com/blefebvre/phonegap-plugin-contentsync-copyCordovaAssets-bug

Logs taken while reproducing problem

Last thing printed to the Xcode console is Requesting local copy of synced

macdonst commented 6 years ago

@blefebvre yup, that's a bug. It only works if copyRootApp: true. Feel free to send a PR for this 😈