Skip to content

Commit

Permalink
Support for NativeScript 6 #216
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Jul 30, 2019
1 parent 37d4972 commit bf5f974
Show file tree
Hide file tree
Showing 27 changed files with 14 additions and 15 deletions.
14 changes: 7 additions & 7 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
"nativescript": {
"id": "org.nativescript.plugindemo.barcodescanner",
"tns-ios": {
"version": "6.0.0-rc-2019-06-28-105002-01"
"version": "6.0.1"
},
"tns-android": {
"version": "6.0.0-rc-2019-06-27-172817-03"
"version": "6.0.0"
}
},
"dependencies": {
"nativescript-barcodescanner": "file:../src",
"nativescript-theme-core": "^1.0.4",
"nativescript-unit-test-runner": "0.6.3",
"tns-core-modules": "6.0.0-rc-2019-06-28-175837-02"
"nativescript-unit-test-runner": "0.7.0",
"tns-core-modules": "6.0.1"
},
"devDependencies": {
"jasmine-core": "^2.5.2",
"karma": "4.1.0",
"karma-jasmine": "2.0.1",
"karma-nativescript-launcher": "^0.4.0",
"nativescript-css-loader": "~0.26.1",
"nativescript-dev-webpack": "1.0.0-rc-2019-07-02-161545-02",
"tns-platform-declarations": "6.0.0-rc-2019-06-28-175837-02",
"nativescript-dev-webpack": "1.0.1",
"tns-platform-declarations": "6.0.1",
"tslint": "~5.11.0",
"typescript": "3.4.1",
"typescript": "3.4.5",
"karma-webpack": "3.0.5"
},
"scripts": {
Expand Down
7 changes: 3 additions & 4 deletions src/barcodescanner.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ScanOptions,
ScanResult
} from "./barcodescanner-common";
import * as utils from "tns-core-modules/utils/utils";

export class BarcodeScannerView extends BarcodeScannerBaseView {

Expand Down Expand Up @@ -119,7 +118,7 @@ export class BarcodeScanner {
return;
}

this._audioSession = utils.ios.getter(AVAudioSession, AVAudioSession.sharedInstance);
this._audioSession = AVAudioSession.sharedInstance();
this._audioSession.setActiveError(true);
this._currentVolume = this._audioSession.outputVolume;
if (!this._observerActive) {
Expand Down Expand Up @@ -208,7 +207,7 @@ export class BarcodeScanner {
// only need for denied permission as conveniently, this method will auto-request permission upon scan
if (this._hasDeniedCameraPermission()) {
if (arg.openSettingsIfPermissionWasPreviouslyDenied) {
utils.ios.getter(UIApplication, UIApplication.sharedApplication).openURL(NSURL.URLWithString(UIApplicationOpenSettingsURLString));
UIApplication.sharedApplication.openURL(NSURL.URLWithString(UIApplicationOpenSettingsURLString));
}
reject("The user previously denied permission to access the camera.");
return;
Expand Down Expand Up @@ -491,7 +490,7 @@ class QRCodeReaderDelegateImpl extends NSObject implements QRCodeReaderDelegate
class VolumeObserverClass extends NSObject {
observeValueForKeyPathOfObjectChangeContext(path: string, obj: Object, change: NSDictionary<any, any>, context: any) {
if (path === "outputVolume") {
let volumeLevel = utils.ios.getter(MPMusicPlayerController, MPMusicPlayerController.applicationMusicPlayer).volume;
let volumeLevel = MPMusicPlayerController.applicationMusicPlayer.volume;
if (volumeLevel > this["_owner"]._currentVolume) {
// volume up button pressed, so enable torch
this["_owner"]._enableTorch();
Expand Down
8 changes: 4 additions & 4 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-barcodescanner",
"version": "3.2.1",
"version": "3.2.2",
"description": "Scan QR/barcodes with your NativeScript app.",
"main": "barcodescanner",
"typings": "index.d.ts",
Expand Down Expand Up @@ -69,9 +69,9 @@
},
"homepage": "https://github.com/eddyverbruggen/nativescript-barcodescanner",
"devDependencies": {
"tns-core-modules": "~5.2.2",
"tns-platform-declarations": "~5.2.2",
"typescript": "~2.8.0",
"tns-core-modules": "~6.0.0",
"tns-platform-declarations": "~6.0.0",
"typescript": "3.4.5",
"prompt": "^1.0.0",
"rimraf": "^2.6.2",
"tslint": "^5.11.0",
Expand Down

0 comments on commit bf5f974

Please sign in to comment.