I'm trying on code push in my Visual studio project now. I done installing cordova plugin code push and able to see the instance with console.log(codePush)
.
Now I try to run codePush.checkForUpdate()
and I notice that I need to fill in the Deployment Key in config.xml.
I read several articles about deployment key but all of them use the Ionic CLI to create the project and they can retrieve the deployment key in CLI. But I don't see any option in Visual Studio for that nor see any deployment key info anywhere.
Please advice on how to get the deployment key for my Visual Studio project in order to enable codePush.
After many hours of struggle, I found a solution on this. As a result, I actually need to follow EVERY single step as provided here, here and here. I really need to cross check between these 3 links to make things work.
Here is what I did:
1) In Visual Studio Package Manager Console, do this
npm install -g code-push-cli
. This will install the necessary for CodePush CLI2) In the console, do
code-push register
. This will open a browser and register your account and associate with github or microsoft platform for code sync later on.3) After successful registration, do
code-push login
. This will open up the browser and generate an access key for you. Suppose, a CLI will pop up and allow you to key in the access key for login. But in my case, the console hang. So I have to docode-push login --accessKey <accessKey>
method to login.4) After that, do
code-push app add <app_name>
to register the app. This will send info to code push server and allow your app to perform code push5) Do
code-push deployment add <app_name> "Staging"
to enable the app for deployment to server6) When adding for deployment is successful, do
code-push deployment ls <app_name> -k
to retrieve the Deployment Key for Staging and ProductionI still need to trial-and-error for using the code in the application. But at least I'm manage to get the deployment key for now.
Hope it helps those who are using ionic with code push