A custom code push (microsoft appcenter) service by NEXTGEN Code Company
> Select iOS & Cordova
> Put them into your project config.ts
``
`
> :warning: _Make sure to remove and add platform again_
\\ Cordova will not like it if you do not have CodePushDeploymentKey in config.xml even though this service will be overwriting it
`
...app.module.ts...
import { NGCodePushService } from '@nextgencodecompany/ng-code-push';
...
providers:[
NGCodePushService
]
`
`
...app.component.ts...
import { NGCodePushService, NGCodePushConfig } from '@nextgencodecompany/ng-code-push';
import { Config } from '../wherever/project/config/is';
...
constructor( public ngCodePush: NGCodePushService ) {
// set config for ng-code-push
const code_push_config: NGCodePushConfig = {
project_name: Config.project_name,
on: (Config.dev_mode ? false : Config.codePush.on),
version: Config.version,
ignoreFailedUpdates: Config.codePush.ignoreFailedUpdates,
deploymentKey: Config.codePush.deploymentKey,
displayUpdatePrompts: Config.codePush.displayUpdatePrompts,
stagingDeploymentKey: Config.codePush.stagingDeploymentKey
};
this.ngCodePush.setConfig(code_push_config);
}
`
`
*ngIf="mc.isApp"
(click)="ngCodePush.checkForUpdate()"
tappable
>
*ngIf="ngCodePush.loading"
name="crescent"
>
(ionChange)="ngCodePush.setCodePushToasts($event.detail.checked)"
>
(ionChange)="ngCodePush.setBetaChannel($event.detail.checked)"
>
`
```
npm run deploy
This is a full Ionic project directory that only exports and publishes the ng-code-push service.
You can test by running the typical ionic commands.
Please test before publishing.