Socket
Socket
Sign inDemoInstall

nativescript-rad-imagepicker-with-loc

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nativescript-rad-imagepicker-with-loc

Whatsapp style imagepicker for NativeScript apps


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
79.7 kB
Created
Weekly downloads
 

Readme

Source

NativeScript Rad Imagepicker Plugin apple android

This is a very slightly modified plugin. Original is here: https://github.com/nstudio/nativescript-rad-imagepicker

This version adds recordLocation to the configurable options.

NativeScript plugin for whatsapp style image picking. This Plugin uses PixImagePicker for Android and ImagePicker for iOS

      

Installation

npm install nativescript-rad-imagepicker-with-loc

you will need to reference the above package in place of @nstudio/nativescript-rad-imagepicker' below

Usage

const RadImagepicker = require('@nstudio/nativescript-rad-imagepicker').RadImagepicker;
const PickerOptions = require('@nstudio/nativescript-rad-imagepicker').PickerOptions;
const radImagepicker = new RadImagepicker();
radImagepicker.pick(opts).then((selectedImages) => {
    if (selectedImages) {
        // Do something with selected images
        // currently 
        // the image will be of type nativescript image source
        // tns-core-modules/image-source
    }
});

API

Following picker options are available

PickerOptions {
    doneButtonTitle?: string; // only affects ios
    noImagesTitle?: string; // only affects ios
    allowVideoSelection?: boolean; // only affects ios
    recordLocation?: boolean; // only affects ios
    imageLimit?: number;
}

Picker api

pick(options: PickerOptions): Promise<Array<any>>;

When the promise resolves, you will get array of imageSource

Theming

Android

Add desired colors in app/App_Resources/Android/src/main/res/values/colors.xml

<color name="ns_blue">#272734</color>
<color name="colorPrimaryPix">#075e54</color>
<color name="colorPrimaryLightPix">#80075e54</color>

Permissions

Android

Make sure these lines are in your Manifest.xml

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />

iOS

Add these to info.plist, you can add more descriptive message here

<key>NSCameraUsageDescription</key>
<string>This app uses your camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app uses your photo library</string>

Made With ♥️ for {N} Community by nStudio

Special Thanks to Richard Smith and Osei Fortune :)

License

Apache License Version 2.0, January 2004

Keywords

FAQs

Last updated on 18 May 2020

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.

Install

Related posts

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