Есть ли способ проверить через phoneGap.js, есть ли мой плагин или нет?Я хочу, чтобы в моем приложении была условная логика, чтобы оно не использовало содержимое моего плагина, если его там нет.
if (typeof window.plugins.myplugin !== 'undefined'){ // plugin is available }
Посмотрите на окно.PhoneGap.resources Объект:
window.PhoneGap.resources
Object • accelerometer: true • app: true • base: true • battery: true • camera: true • capture: true • compass: true • contact: true • crypto: true • device: true • file: true • filetransfer: true • geolocation: true • media: true • network: true • notification: true • position: true • storage: true • __proto__: Object