danielehrhardt / cordova-plugin-extended-device-information

7 stars 8 forks source link

Plugin breaks iOS execution. #5

Closed AUK4GIT closed 6 years ago

AUK4GIT commented 6 years ago

I have been trying to integrate the plugin. I fell some code changes are to be done in extended-device-information.js file.

Replace channel.onCordovaInfoReady.fire(); with channel.onCordovaReady.fire();

Enclose me.getInfo(function (info) {...} inside if(cordova.platformId === 'android') {...} this helps fix iOS plugin failure issue. ``` if(cordova.platformId === 'android') { me.getInfo(function (info) { var buildLabel = cordova.version; me.memory = info.memory || 'unknown'; me.cpumhz = info.cpumhz || 'unknown'; me.totalstorage = info.totalstorage || 'unknown';

 channel.onCordovaInfoReady.fire();

}, function (e) { me.available = false; utils.alert("[ERROR] Error initializing Cordova: " + e); }); }