Skip to content

Commit

Permalink
fix(analytics): Use the correct app version number for analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Nov 19, 2016
1 parent 48b954b commit bdc65f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<plugin name="cordova-plugin-apprate" spec="~1.2" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" />
<plugin name="cordova-plugin-app-version" spec="~0.1.9" />
</widget>
15 changes: 14 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Component, ViewChild } from '@angular/core';
import { Platform, Nav } from 'ionic-angular';
import { StatusBar } from 'ionic-native';
import { StatusBar, AppVersion } from 'ionic-native';

import { LogInPage } from '../pages/login/login';
import { GAService } from '../core';


@Component({
template: `<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>`
Expand All @@ -20,6 +22,17 @@ export class MyApp {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();


AppVersion.getVersionNumber().then(
(version)=> GAService.appVersion = version
);

if(platform.is('ios')){
GAService.appName = "ios";
}else{
GAService.appName = "android";
}
});
}
}
2 changes: 1 addition & 1 deletion src/core

0 comments on commit bdc65f6

Please sign in to comment.