nativescript-applist
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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:

Name Description
displayName The display name
icon If available: The icon as data url
name The internal (package) name
version.code The version code (Android only)
version.name The 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:

Name Description
icon.format The icon format. 0 = PNG, 1 = JPEG
icon.quality The icon quality between 0 and 100
withIcons Also loads icons for each entry or not

Readme

Keywords

Package Sidebar

Install

npm i nativescript-applist

Weekly Downloads

1

Version

2.0.1

License

MIT

Last publish

Collaborators

  • mkloubert