Recently, I came across the nativescript-appList Plugin, but unfortunately encountered a runtime error stating "Cannot read property getPackageManager
of undefined."
My code implementation within the constructor of an Angular2-NativeScript project is as follows:
import * as AppList from "nativescript-applist";
// inside the constructor
console.log("First", "Test");
AppList.getInstalledApps(function(apps) {
console.log("Second", "Test");
}, {
withIcons: true
});
Strangely, when running the application in the command prompt, only the log for "console.log("First", "Test");" appears, while the expected log for "console.log("Second", "Test");" doesn't show up.