Viras- / cordova-plugin-powermanagement

Cordova PowerManagement plugin
Apache License 2.0
54 stars 106 forks source link

IOS compile errors #17

Open vcrepin opened 8 years ago

vcrepin commented 8 years ago

Hello. I'm using the latest version of ionic framework (1.2) and this plugin does not compile for IOS. Here are the errors:

/Users/vincentcrepin/ionicProjects/BlitzClock/platforms/ios/BlitzClock/Plugins/at.gofg.sportscomputer.powermanagement/PowerManagement.m:39:28: error: no visible @interface for 'CDVPluginResult' declares the selector 'toSuccessCallbackString:' jsString = [result toSuccessCallbackString:callbackId];

/Users/vincentcrepin/ionicProjects/BlitzClock/platforms/ios/BlitzClock/Plugins/at.gofg.sportscomputer.powermanagement/PowerManagement.m:43:28: error: no visible @interface for 'CDVPluginResult' declares the selector 'toErrorCallbackString:'
jsString = [result toErrorCallbackString:callbackId];
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
/Users/vincentcrepin/ionicProjects/BlitzClock/platforms/ios/BlitzClock/Plugins/at.gofg.sportscomputer.powermanagement/PowerManagement.m:46:11: error: no visible @interface for 'PowerManagement' declares the selector 'writeJavascript:'
[self writeJavascript:jsString];
~~~~ ^~~~~~~~~~~~~~~
/Users/vincentcrepin/ionicProjects/BlitzClock/platforms/ios/BlitzClock/Plugins/at.gofg.sportscomputer.powermanagement/PowerManagement.m:63:28: error: no visible @interface for 'CDVPluginResult' declares the selector 'toSuccessCallbackString:'
jsString = [result toSuccessCallbackString:callbackId];
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
/Users/vincentcrepin/ionicProjects/BlitzClock/platforms/ios/BlitzClock/Plugins/at.gofg.sportscomputer.powermanagement/PowerManagement.m:67:28: error: no visible @interface for 'CDVPluginResult' declares the selector 'toErrorCallbackString:'
jsString = [result toErrorCallbackString:callbackId];
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
/Users/vincentcrepin/ionicProjects/BlitzClock/platforms/ios/BlitzClock/Plugins/at.gofg.sportscomputer.powermanagement/PowerManagement.m:70:11: error: no visible @interface for 'PowerManagement' declares the selector 'writeJavascript:'
[self writeJavascript:jsString];
jhanish commented 7 years ago

I have same issue. Any movement on this?

klochko7 commented 7 years ago

I have same issue too. Any movement on this?

andre-arsenault commented 7 years ago

I encountered the same problem and found a solution on this thread: https://stackoverflow.com/questions/28850016/how-do-i-replace-the-deprecated-methods-tosuccesscallbackstring-and-writejavascr

andre-arsenault commented 7 years ago

Apparently the code has already been fixed in this repository (see this pull request) but the NPM package hasn't been updated. So many people may have the broken version installed.

I suggest re-installing the plug-in via the cordova command-line instead of npm. $ cordova plugin add https://github.com/Viras-/cordova-plugin-powermanagement.git

emcniece commented 6 years ago

Confirming @andre-arsenault - installing from git repo works.

ionic cordova plugin rm at.gofg.sportscomputer.powermanagement
ionic cordova plugin add https://github.com/Viras-/cordova-plugin-powermanagement.git