Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
nativescript-imagepicker
Advanced tools
Readme
Imagepicker plugin supporting both single and multiple selection.
Plugin supports iOS8+ and uses Photos Framework.
For Android it uses Intents to open the stock images or file pickers. For Android 6 (API 23) and above the permissions to read file storage should be explicitly required. See demo for implementation details.
In Command prompt / Terminal navigate to your application root folder and run:
tns plugin add nativescript-imagepicker
The best way to explore the usage of the plugin is to inspect both demo apps in the plugin repository.
In demo
folder you can find the usage of the plugin for TypeScript non-Angular application. Refer to demo/app/main-page.ts
.
In demo-angular
is the usage in an Angular app. Refer to demo-angular/app/app.component.ts
.
In addition to the plugin usage, both apps are webpack configured.
In short here are the steps:
TypeScript
import * as imagepicker from "nativescript-imagepicker";
Javascript
var imagepicker = require("nativescript-imagepicker");
Create imagepicker in single
or multiple
mode to specifiy if the imagepicker will be used for single or multiple selection of images
TypeScript
let context = imagepicker.create({
mode: "single" // use "multiple" for multiple selection
});
Javascript
var context = imagepicker.create({ mode: "single" }); // use "multiple" for multiple selection
context
.authorize()
.then(function() {
return context.present();
})
.then(function(selection) {
selection.forEach(function(selected) {
// process the selected image
});
list.items = selection;
}).catch(function (e) {
// process error
});
NOTE: To request permissions for Android 6+ (API 23+) we use nativescript-permissions.
Option | Platform | Default | Description |
---|---|---|---|
mode | both | multiple | The mode if the imagepicker. Possible values are single for single selection and multiple for multiple selection. |
doneText | iOS | Done | The text of the "Done" button on top right. |
cancelText | iOS | Cancel | The text of the "Cancel" button on top left. |
albumsText | iOS | Albums | The title of the "Albums" screen from where the selection of album and images can be done. |
newestFirst | iOS | false | Set to true to sort the images in an album by newest first. |
Property | Default | Description |
---|---|---|
selection | null | An array of selected image assets. |
albums | null | Albums from where the images are picked. |
2015, Telerik AD
FAQs
A plugin for the NativeScript framework implementing multiple image picker
We found that nativescript-imagepicker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).