nativescript-camera
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -140,2 +140,12 @@ "use strict"; | ||
}; | ||
exports.requestPhotosPermissions = function () { | ||
return permissions.requestPermissions([ | ||
android.Manifest.permission.WRITE_EXTERNAL_STORAGE, | ||
]); | ||
}; | ||
exports.requestCameraPermissions = function () { | ||
return permissions.requestPermissions([ | ||
android.Manifest.permission.CAMERA | ||
]); | ||
}; | ||
var createDateTimeStamp = function () { | ||
@@ -142,0 +152,0 @@ var result = ""; |
@@ -165,8 +165,8 @@ "use strict"; | ||
return new Promise(function (resolve, reject) { | ||
requestPhotosPermissions().then(function () { | ||
requestCameraPermissions().then(resolve, reject); | ||
exports.requestPhotosPermissions().then(function () { | ||
exports.requestCameraPermissions().then(resolve, reject); | ||
}, reject); | ||
}); | ||
}; | ||
var requestPhotosPermissions = function () { | ||
exports.requestPhotosPermissions = function () { | ||
return new Promise(function (resolve, reject) { | ||
@@ -207,3 +207,3 @@ var authStatus = PHPhotoLibrary.authorizationStatus(); | ||
}; | ||
var requestCameraPermissions = function () { | ||
exports.requestCameraPermissions = function () { | ||
return new Promise(function (resolve, reject) { | ||
@@ -210,0 +210,0 @@ var cameraStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo); |
@@ -12,3 +12,5 @@ import imageAsset = require("tns-core-modules/image-asset/image-asset"); | ||
*/ | ||
export function requestPermissions(); | ||
export function requestPermissions(): Promise<any>; | ||
export function requestCameraPermissions(): Promise<any>; | ||
export function requestPhotosPermissions(): Promise<any>; | ||
@@ -15,0 +17,0 @@ /** |
{ | ||
"name": "nativescript-camera", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "Provides API for using device camera", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -37,3 +37,5 @@ # NativeScript Camera [![Build Status](https://travis-ci.org/NativeScript/nativescript-camera.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-camera) | ||
| takePicture(options?: CameraOptions) | Take a photo using the camera with an optional parameter for setting different camera options. | | ||
| requestPermissions() | Check required permissions for using device camera. Returns a Promise. | | ||
| requestPermissions() | Request permission from the user for access to their saved photos as well as access to their camera. Returns a Promise. | | ||
| requestCameraPermissions() | Request permission from the user for access to their camera. Returns a Promise. | | ||
| requestPhotosPermissions() | Request permission from the user for access to their saved photos. Returns a Promise. | | ||
| isAvailable() | Is the device camera available to use. | | ||
@@ -40,0 +42,0 @@ |
50681
471
187