Reputation: 159
I'm new at ionic framework and mobile apps, Is there any plugin or method to get list of installed apps on android devices?
Upvotes: 2
Views: 2888
Reputation: 69
Add
import * as Applist from 'cordova-plugin-applist2/www/Applist.js';
import { Platform } from '@ionic/angular';
to your component .ts file
Then to use it in probably constructor
constructor(public platform: Platform) {
platform.ready().then(
function(){
if(platform.is('android') && !platform.is('mobileweb')){
var success = function(app_list) {
//success function
console.log(app_list);
};
var error = function(app_list) {
//error
console.log("An Error occured while fetching App Lists");
console.error(app_list);
};
//for the date parameters, any date is okay,
//the first date should be in the past
Applist.createEvent('', '', '', new Date(1999, 10, 11, 12, 12, 12, 12), new Date(), success, error);
}
}
);
}
Upvotes: 0
Reputation: 11935
There is indeed a ready-made Cordova plugin available that gives the list of installed apps in the device. This AppList Plugin should help you out.
Infact it gives the app icon as well.
UPDATE: There are no such ready-made plugin available yet for iOS as far as I know.
Upvotes: 3