From 4024a5e3123cfc36a7a360d3f94bf2bad740908c Mon Sep 17 00:00:00 2001 From: NickIliev Date: Wed, 26 Jun 2019 10:31:50 +0300 Subject: [PATCH] removed deprecated APIs --- .../app-using-android-specifics.component.ts | 1 - .../app-using-ios-specifics.component.ts | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/ng-framework-modules-category/application/app-using-android-specifics/app-using-android-specifics.component.ts b/app/ng-framework-modules-category/application/app-using-android-specifics/app-using-android-specifics.component.ts index 9c923ccb..8595eb77 100644 --- a/app/ng-framework-modules-category/application/app-using-android-specifics/app-using-android-specifics.component.ts +++ b/app/ng-framework-modules-category/application/app-using-android-specifics/app-using-android-specifics.component.ts @@ -26,7 +26,6 @@ export class AppUsingAndroidExampleComponent { let packageName = androidApp.packageName; // The package ID e.g. org.nativescript.nativescriptsdkexamplesng let nativeApp = androidApp.nativeApp; // The native APplication reference let foregroundActivity = androidApp.foregroundActivity; // The current Activity reference - let currentContext = androidApp.currentContext; // The current Android context let context = androidApp.context; console.log(context); // The current Android context // << app-class-properties diff --git a/app/ng-framework-modules-category/application/app-using-ios-specifics/app-using-ios-specifics.component.ts b/app/ng-framework-modules-category/application/app-using-ios-specifics/app-using-ios-specifics.component.ts index e966149b..c3dc5f52 100644 --- a/app/ng-framework-modules-category/application/app-using-ios-specifics/app-using-ios-specifics.component.ts +++ b/app/ng-framework-modules-category/application/app-using-ios-specifics/app-using-ios-specifics.component.ts @@ -1,6 +1,5 @@ import { Component } from "@angular/core"; import { android as androidApp, ios as iosApp } from "tns-core-modules/application"; -import { ios as iosUtils } from "tns-core-modules/utils/utils"; @Component({ moduleId: module.id, @@ -33,13 +32,13 @@ export class AppUsingIosExampleComponent { this.batteryLife = 0; // >> app-ios-observer-code - iosUtils.getter(UIDevice, UIDevice.currentDevice).batteryMonitoringEnabled = true; - this.batteryLife = +(iosUtils.getter(UIDevice, UIDevice.currentDevice).batteryLevel * 100); + UIDevice.currentDevice.batteryMonitoringEnabled = true; + this.batteryLife = +(UIDevice.currentDevice.batteryLevel * 100); let that = this; let observer = iosApp.addNotificationObserver(UIDeviceBatteryLevelDidChangeNotification, function onReceiveCallback(notification: NSNotification) { - that.batteryLife = +(iosUtils.getter(UIDevice, UIDevice.currentDevice).batteryLevel * 100); + that.batteryLife = +(UIDevice.currentDevice.batteryLevel * 100); }); // << app-ios-observer-code