@zecky-dev/react-native-app-list
Version:
Retrieves a list of all installed apps on an Android device and allows checking whether a specific app is installed.
20 lines (19 loc) • 676 B
JavaScript
;
import { NativeModules } from 'react-native';
const AppList = NativeModules.AppList;
if (!AppList) {
console.warn('WARN: Native AppList module is not available. ' + 'Make sure the native module is correctly linked and rebuilt for your platform.');
}
export function getInstalledApps() {
if (!AppList) {
return Promise.reject(new Error('AppList native module is not available.'));
}
return AppList.getInstalledApps();
}
export function isAppInstalled(packageName) {
if (!AppList) {
return Promise.reject(new Error('AppList native module is not available.'));
}
return AppList.isAppInstalled(packageName);
}
//# sourceMappingURL=index.js.map