0.0.4 • Published 5 years ago

cordova-plugin-pix v0.0.4

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

A Cordova Plugin for Pix Image Picker

This plugin is a port of Pix (WhatsApp Style Image Picker) for using with Cordova.

Demo

Clone the sample repository

cdv-pix-screenshot

cordova.plugins.Pix.open(
    {
        success: function(response){},
        error: function(e){},
        quality: 50       
    }
);

Installation

$ cordova plugin add cordova-plugin-pix

Requirements

The following platforms and versions are supported by the latest release:

  • Android 4.4+
  • Cordova CLI 7.0 or higher

Pix.open(callbackContext)

Opens Pix Image Picker and get selected files back as an object.

Supported Platforms

  • Android 4.4+

Quick Examples

Open Pick Imager Picker and set a callback for success or fail events.

cordova.plugins.Pix.open(
    { 
        success: function(response) {
            console.log(response);
        },
        error: function(e) {
            console.error(e);
        },
        quality: 50
    }
);

Format of the response:

{
    "status": -1,
    "message": "RESULT_OK",
    "data": [
        {
            "file": "/storage/emulated/0/DCIM/Camera/IMG_20190415_182649.jpg",
            "base64": "/9j/4AAQSkZJRgABAQA...",
            "type": "image/jpeg",
            "prefix": "data:image/jpeg;charset=utf-8;base64,"
        }, 
        {
            "file": "/storage/emulated/0/DCIM/Camera/IMG_20190415_182644.jpg",
            "base64": "/9j/4AAQSkZJRgABAQA...",
            "type": "image/jpeg",
            "prefix": "data:image/jpeg;charset=utf-8;base64,"
        }
    ]
}