Socket
Socket
Sign inDemoInstall

nativescript-camera

Package Overview
Dependencies
2
Maintainers
11
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.1 to 4.2.0

1

camera.android.js

@@ -9,3 +9,2 @@ "use strict";

var REQUEST_IMAGE_CAPTURE = 3453;
var REQUEST_REQUIRED_PERMISSIONS = 1234;
exports.takePicture = function (options) {

@@ -12,0 +11,0 @@ return new Promise(function (resolve, reject) {

12

package.json
{
"name": "nativescript-camera",
"version": "4.1.1",
"version": "4.2.0",
"description": "Provides API for using device camera",

@@ -13,4 +13,4 @@ "repository": {

"platforms": {
"android": "3.0.0",
"ios": "3.0.0"
"android": "4.0.0",
"ios": "4.0.0"
}

@@ -50,5 +50,5 @@ },

"devDependencies": {
"tns-core-modules": "^5.0.1",
"tns-platform-declarations": "^5.0.0",
"typescript": "~2.8.2",
"tns-core-modules": "^5.2.0",
"tns-platform-declarations": "^5.2.0",
"typescript": "~3.1.6",
"prompt": "^1.0.0",

@@ -55,0 +55,0 @@ "rimraf": "^2.6.2",

@@ -37,3 +37,3 @@ # 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. |
| requestPermissions() | Check required permissions for using device camera. Returns a Promise. |
| isAvailable() | Is the device camera available to use. |

@@ -57,11 +57,28 @@

Newer API levels of Android and iOS versions are requiring explicit permissions in order the application
to have access to the camera and to be able to save photos to the device. Once the user has granted permissions the camera module can be used.
Both Android and iOS require explicit permissions in order for the application to have access to the camera and save photos to the device. Once the user has granted permissions the camera module can be used.
```JavaScript
camera.requestPermissions().then(
function success() {
// permission request accepted or already granted
// ... call camera.takePicture here ...
},
function failure() {
// permission request rejected
// ... tell the user ...
}
);
```
camera.requestPermissions();
> **Note for Android:** Older versions of Android that don't use a request permissions popup won't be affected by the usage of the requestPermissions method.
> **Note for iOS:** If the user rejects permissions from the iOS popup, the app is not allowed to ask again. You can instruct the user to go to app settings and enable the camera permission manually from there. Additionally, [App Store Guideline 5.1.1](https://developer.apple.com/app-store/review/guidelines/#data-collection-and-storage) requires apps to clarify the usage of the camera and photo library. To do so, edit your `app/App_Resources/iOS/Info.plist` and add the following clarifications:
```
<key>NSCameraUsageDescription</key>
<string>enter your camera permission request text here</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>enter your photo library permission request text here</string>
```
> Note: Older versions won't be affected by the usage of the requestPermissions method.
### Using the camera module to take a picture

@@ -68,0 +85,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc