GithubHelp home page GithubHelp logo

weaveroftheweb / cordova-plugin-intent-list Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nick-denry/cordova-plugin-intent-list

0.0 0.0 0.0 30 KB

Cordova/phonegap plugin to get Android installed applications with icons

License: Apache License 2.0

Java 95.68% JavaScript 4.32%

cordova-plugin-intent-list's Introduction

Simple phonegap plugin to get Android installed apps with base64 icons

Version Downloads Platforms License PayPayl donate button

Demo.

1. Installation

cordova plugin add cordova-plugin-intent-list

or directly via git (unstable)

cordova plugin add https://github.com/nick-denry/cordova-plugin-intent-list

2. Usage

navigator.IntentList.getList(success, error);
navigator.IntentList.getList(function(applist) {
    console.log(applist);
}, function(errorMesssage) {
    console.log(errorMesage);
});

applist will contain array of JSON objects.

[
  {
    "label": "Chrome",
    "package": "com.android.chrome",
    "packageIcon": "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAABHNCSVQICAgIfAhkiAAAIABJREF..."
  },
  ...
]

3. Update Content Security Policy

Add img-src 'self' data:; to your CSP declaration to allow data:image images, i.e.:

<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' gap:; style-src 'self' 'unsafe-inline'; img-src 'self' data:; media-src *" />

โš ๏ธ NOTE Do not use wide open CSP declaration in production. @see https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/#content-security-policy

4. Credits

5. License

Licensed under Apache 2.0. Please see License File for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.