microsoft / cordova-plugin-code-push

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

How do i show the current CodePush Version label in my app #651

Open mohamedMobileSpot opened 4 years ago

mohamedMobileSpot commented 4 years ago

Additional Information

cordova-plugin-code-push version: 1.13.1 "cordova-plugin-whitelist": "^1.3.4", "code-push": "^3.0.1", "cordova-android": "^8.0.0",

szh commented 4 years ago

To show the version of the currently installed codepush update, use codePush.getCurrentPackage. See the docs here https://github.com/microsoft/cordova-plugin-code-push#codepushgetcurrentpackage

mohamedMobileSpot commented 4 years ago

To show the version of the currently installed codepush update, use codePush.getCurrentPackage. See the docs here https://github.com/microsoft/cordova-plugin-code-push#codepushgetcurrentpackage

i know that codePush.checkForUpdate and codePush.getCurrentPackage function give me the localPackage information but they only give the current information only if the binary code is from code push but for my case i want it evry time i need it even when the app is loaded from store not updated from code push

PRA1995SAG commented 4 years ago

In case of cordova platform

mohamedMobileSpot commented 4 years ago

In case of cordova platform

  • when you use codepush.sync() or codepush.checkForUpdate()
  • get details about the updates by codePush.getCurrentPackage()
  • to store and retrive required information in entire app use localStorage
  • Window.localStorage

thank you for the solution i will test it 👍