microsoft / cordova-plugin-code-push

Cordova plugin for CodePush
http://appcenter.ms
Other
644 stars 324 forks source link

Add binaryUpdateCallback to checkForUpdate & sync methods #669

Open elgerlambert opened 3 years ago

elgerlambert commented 3 years ago

This PR resolves #260.

As per https://github.com/microsoft/cordova-plugin-code-push/issues/260#issuecomment-311580943 this PR adds an additional callback to codePush.sync & checkForUpdate methods in a similar vein as react-native-code-push.

All the changes are purely additive, so no breaking changes. This does mean the syncCallback is still called with status UP_TO_DATE (directly after the newly added binaryUpdateCallback is called).

The binaryUpdateCallback is called with a NativeUpdateNotification object. Unfortunately this object doesn't contain a lot of useful info (only the binary target as appVersion). Other RemotePackage properties, such as isMandatory for example, are missing. To change/improve this, would require making changes to the (parent) code-push repo, specifically around this line. This may be considered as further action.

ghost commented 3 years ago

CLA assistant check
All CLA requirements met.