CodePush & Ionic

Good morning/afternoon.

Can anyone direct me to a proper Ionic 2 and CodePush usage document?

This doesn’t seem to be working for me.

Using Ionic 2.0.0 RC 3

I got it fixed. Thanks everyone who replied. >_>…

Anyway, for anyone else who’s facing any problem, here’s what I did.

in app.ts update Component to:

@Component({
  templateUrl: 'app.html',
  providers:[CodePush]
})

in your constructor put:

 platform.ready().then(() => {
 Splashscreen.hide();
 CodePush.sync().subscribe((syncStatus) => console.log(syncStatus));
 
    StatusBar.styleDefault();
      StatusBar.backgroundColorByName("gray");
     
    });
  }
}

In my config xml under android platform:

<preference name="CodePushDeploymentKey" value="COWJ2vO8xr-ZWE8zS3RdHzJzBXPq4yxBVSofM"/>

And you’re all set. your app updates without the end-user being told or affected :).

The only thing I realized is that it increases your app data by alot on every update…Is this normal?

2 Likes

For the guys who are wondering how to import codepush here is an example:
import { CodePush } from 'ionic2-code-push';

1 Like

Hi
From which folder do you run code-push release-cordova <appName> <platform> ?

When I run it from the app’s root (the folder contains config.xml) I get this error:

[Error] Please use a semver-compliant target binary version range, for example "1.0.0", "*" or "^1.2.3".

Thanks

What target binary version range are you entering?

Oh, the app’s root folder. My apologies for the late reply.