remove cordova-plugin-app-version as it only creates issues

ios
Norwin 6 years ago
parent 4fc0dbaa89
commit 07b34a8185

36
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "blockly-sensebox", "name": "openSenseApp",
"version": "1.0.1", "version": "0.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -91,14 +91,6 @@
"tslib": "^1.7.1" "tslib": "^1.7.1"
} }
}, },
"@ionic-native/app-version": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ionic-native/app-version/-/app-version-5.1.0.tgz",
"integrity": "sha512-u+j319sZBBGjf0MjeMhxKpT+iwL8R6bq4MBAbQOV+x/pyGuqed0RvoEZ5TO/XEpBLYrizkiKGffaNqlxHm1W+A==",
"requires": {
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/core": { "@ionic-native/core": {
"version": "4.15.0", "version": "4.15.0",
"resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-4.15.0.tgz", "resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-4.15.0.tgz",
@ -1068,11 +1060,6 @@
"resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-2.0.1.tgz", "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-2.0.1.tgz",
"integrity": "sha1-qmd4jmS/qGUmkad7Ais7QDEgkRM=" "integrity": "sha1-qmd4jmS/qGUmkad7Ais7QDEgkRM="
}, },
"@types/cordova": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
},
"abbrev": { "abbrev": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@ -2843,11 +2830,6 @@
} }
} }
}, },
"cordova-plugin-app-version": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/cordova-plugin-app-version/-/cordova-plugin-app-version-0.1.9.tgz",
"integrity": "sha1-nbBgeGMzenEEiTAuX1CpBPFEm9s="
},
"cordova-plugin-device": { "cordova-plugin-device": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz",
@ -3681,7 +3663,8 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -4046,7 +4029,8 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -4094,6 +4078,7 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -4132,11 +4117,13 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true "bundled": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true "bundled": true,
"optional": true
} }
} }
}, },
@ -8016,7 +8003,6 @@
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"

@ -25,7 +25,6 @@
"@angular/http": "5.2.11", "@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11", "@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11", "@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/app-version": "^5.1.0",
"@ionic-native/core": "~4.15.0", "@ionic-native/core": "~4.15.0",
"@ionic-native/network": "^4.17.0", "@ionic-native/network": "^4.17.0",
"@ionic-native/splash-screen": "~4.15.0", "@ionic-native/splash-screen": "~4.15.0",
@ -35,7 +34,6 @@
"@ngx-translate/http-loader": "^2.0.1", "@ngx-translate/http-loader": "^2.0.1",
"cordova-android": "7.1.1", "cordova-android": "7.1.1",
"cordova-browser": "5.0.4", "cordova-browser": "5.0.4",
"cordova-plugin-app-version": "0.1.9",
"cordova-plugin-device": "^2.0.2", "cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3", "cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^2.3.3", "cordova-plugin-ionic-webview": "^2.3.3",
@ -68,8 +66,7 @@
}, },
"cordova-plugin-ionic-keyboard": {}, "cordova-plugin-ionic-keyboard": {},
"wifiwizard2": {}, "wifiwizard2": {},
"cordova-plugin-network-information": {}, "cordova-plugin-network-information": {}
"cordova-plugin-app-version": {}
}, },
"platforms": [ "platforms": [
"android", "android",

@ -11,7 +11,6 @@ import { openSenseApp } from './app.component';
import { OtaWizardPageModule } from '../pages/ota-wizard/ota-wizard.module'; import { OtaWizardPageModule } from '../pages/ota-wizard/ota-wizard.module';
import { BlocklyPageModule } from '../pages/blockly/blockly.module'; import { BlocklyPageModule } from '../pages/blockly/blockly.module';
import { LoggingProvider } from '../providers/logging/logging'; import { LoggingProvider } from '../providers/logging/logging';
import { AppVersion } from '@ionic-native/app-version/ngx';
import { StorageProvider } from '../providers/storage/storage'; import { StorageProvider } from '../providers/storage/storage';
// For AoT compilation (production builds) we need to have a factory for the loader of translation files. // For AoT compilation (production builds) we need to have a factory for the loader of translation files.
@ -47,7 +46,6 @@ export function createTranslateLoader(http: HttpClient) {
StatusBar, StatusBar,
SplashScreen, SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}, {provide: ErrorHandler, useClass: IonicErrorHandler},
AppVersion,
LoggingProvider, LoggingProvider,
StorageProvider, StorageProvider,
] ]

@ -1,5 +1,6 @@
import { LogLevel, LogOptions } from "./providers/logging/logging"; import { LogLevel, LogOptions } from "./providers/logging/logging";
export const APP_VERSION = '1.1.0'
export const COLORS = { export const COLORS = {
PRIMARY: '#4EAF47', // sensebox green PRIMARY: '#4EAF47', // sensebox green
} }

@ -1,9 +1,8 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AppVersion } from '@ionic-native/app-version/ngx';
import { Platform } from 'ionic-angular'; import { Platform } from 'ionic-angular';
import { LOG_OPTIONS } from '../../constants'; import { LOG_OPTIONS, APP_VERSION } from '../../constants';
import { StorageProvider, SETTINGS } from '../storage/storage'; import { StorageProvider, SETTINGS } from '../storage/storage';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
@ -28,23 +27,18 @@ export class LoggingProvider {
constructor( constructor(
private http: HttpClient, private http: HttpClient,
private plt: Platform, private plt: Platform,
private version: AppVersion,
private storage: StorageProvider, private storage: StorageProvider,
private translate: TranslateService, private translate: TranslateService,
) { ) {
if ((<any>window).cordova) { const { defaultFields } = this
this.version.getPackageName() defaultFields.appVersion = APP_VERSION
.then(name => this.defaultFields.app = name) defaultFields.platform = this.plt.platforms().join(' ')
this.version.getVersionNumber() defaultFields.platformVersion = this.plt.version().str
.then(version => this.defaultFields.appVersion = version) defaultFields.lang = translate.currentLang
}
this.defaultFields.platform = this.plt.platforms().join(' ')
this.defaultFields.platformVersion = this.plt.version().str
this.defaultFields.lang = translate.currentLang
} }
createChild (component: string, defaultFields: object = {}) { createChild (component: string, defaultFields: object = {}) {
const child = new LoggingProvider(this.http, this.plt, this.version, this.storage, this.translate) const child = new LoggingProvider(this.http, this.plt, this.storage, this.translate)
Object.assign(child.defaultFields, defaultFields, { component }) Object.assign(child.defaultFields, defaultFields, { component })
return child return child
} }

Loading…
Cancel
Save