2.0.1 • Published 8 years ago

nativescript-applist v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

npm npm

NativeScript AppList

A NativeScript module to handle the list of installed apps on a device.

Donate

License

MIT license

Platforms

  • Android
  • iOS (currently returns empty list!)

Installation

Run

tns plugin add nativescript-applist

inside your app project to install the module.

Demo

For quick start have a look at the demo/app/main-view-model.js file of the demo app to learn how it works.

Otherwise ...

Usage

Include

Include the module in your code-behind:

var AppList = require('nativescript-applist');

Get installed apps

AppList.getInstalledApps(function(apps) {
    for (var i = 0; i < apps.length; i++) {
        // TODO
    }
});

Each item of apps has the following properties:

NameDescription
displayNameThe display name
iconIf available: The icon as data url
nameThe internal (package) name
version.codeThe version code (Android only)
version.nameThe version name

Additional options

// get apps with icons
AppList.getInstalledApps(function(apps) {
    // TODO
}, {
    withIcons: true
});

The 2nd parameter of AppList.getInstalledApps function has the following structure:

NameDescription
icon.formatThe icon format. 0 = PNG, 1 = JPEG
icon.qualityThe icon quality between 0 and 100
withIconsAlso loads icons for each entry or not