Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PushPlugin.m error: no visible @interface for 'UIView' declares the selector 'stringByEvaluatingJavaScriptFromString:' #71

Open
09-dec-76 opened this issue Feb 4, 2016 · 21 comments

Comments

@09-dec-76
Copy link

Hi,

I am getting the following error while building on iOS

Plugins/com.phonegap.plugins.PushPlugin/PushPlugin.m:221:23: error: no visible @interface for 'UIView' declares the selector 'stringByEvaluatingJavaScriptFromString:'
[self.webView stringByEvaluatingJavaScriptFromString:jsCallBack];

Any suggestions.

@DURK
Copy link

DURK commented Feb 4, 2016

I'm getting this too. Haven't figured out a workaround yet. This seems to be related: #58. I'm not using wkWebView, are you?

Xcode 7.2
Cordova 6.0.0
Cordova-ios 4.0.1

@EddyVerbruggen
Copy link

@DURK Easiest fix is using cordova-ios-3 (instead of 4). Btw, there is a fix in the works so this is a temporary inconvenience.

This should do it:

cordova platform remove ios
cordova platform add ios@3.9.2

@DURK
Copy link

DURK commented Feb 4, 2016

@EddyVerbruggen Thanks for the workaround. It works on 3.9.2 like you said 👍

@09-dec-76
Copy link
Author

@EddyVerbruggen It worked. Can we use till the time it's not fixed for 4.0.x

@jadsalhani
Copy link

+1 To know when it's fixed :D

@rafaelshekinah
Copy link

+1

@elegantcoder
Copy link

+1 To know when it's fixed too :D

@benVigie
Copy link

+1

@dexterity42
Copy link

+1

EddyVerbruggen added a commit that referenced this issue Mar 1, 2016
#71 PushPlugin.m error: no visible @interface for 'UIView' declares the selector 'stringByEvaluatingJavaScriptFromString:'
@EddyVerbruggen
Copy link

Hey all, I just pushed cordova-ios-4 support to master and would love you to check it out before closing this issue and tagging a release.

@scamianbas
Copy link

@EddyVerbruggen Hi,
I'm not sure it's related, but while trying to use the plugin https://github.com/EddyVerbruggen/HeadsetDetection-PhoneGap-Plugin you wrote with an ionic app, I'm getting the same kind of errors with cordova-ios-4 and it's working with iOS@3.9.2 with a deprecation warning (see details below).
Sorry not being able to help as I do not have any knowledge about objectiveC and fix your plugin, anyway this may be another clue for this current topic...
Mirko


ios@3.9.2
/Users/mirko/myApp080316/platforms/ios/CPM App/Plugins/nl.x-services.plugins.headsetdetection/HeadsetDetection.m:9:9: warning: 'writeJavascript:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate equivalent of evalJs:. This will be removed in 4.0.0 [-Wdeprecated-declarations]

[self writeJavascript:[result toSuccessCallbackString:callbackId]];

    ^

ios@4.0.0 , ios@4.0.1 , ios@4.1.0

/Users/mirko/myApp080316/platforms/ios/CPM App/Plugins/nl.x-services.plugins.headsetdetection/HeadsetDetection.m:9:33: error: no visible @interface for 'CDVPluginResult' declares the selector 'toSuccessCallbackString:'

[self writeJavascript:[result toSuccessCallbackString:callbackId]];

                     ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

** BUILD FAILED **

@EddyVerbruggen
Copy link

FYI The issue @scamianbas mentioned has been dealt with here.

@benjakraft
Copy link

I have still the same problem. Should it work already with Cordova 4.0.x?

@09-dec-76
Copy link
Author

It's working for me.

On Friday, March 25, 2016, benjakraft notifications@github.com wrote:

I have still the same problem. Should it work already with Cordova 4.0.x?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#71 (comment)

@benjakraft
Copy link

ok need to check again then! Thanks for the info

@abhi7cr
Copy link

abhi7cr commented Apr 5, 2016

+1 for cordova-ios-3. Would love to know when it works with cordova-ios-4.

@09-dec-76
Copy link
Author

It's working for me for 4 as well.

On Wed, Apr 6, 2016 at 12:48 AM, abhishekraj2016@u.northwestern.edu <
notifications@github.com> wrote:

+1 for cordova-ios-3. Would love to know when it works with cordova-ios-4.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#71 (comment)

@mvonlintel
Copy link

This commit ddaa7a1 fixes it for me.
Thanks.

@AilisObrian
Copy link

cordova plugin add https://github.com/Telerik-Verified-Plugins/PushNotification\#ddaa7a1548b01eccbc7f3fdd24f7356057c3931e

@eduardobarbiero
Copy link

This commit ddaa7a1 fixes it for me too.

MayankLogiciel added a commit to MayankLogiciel/PushPlugin that referenced this issue Oct 12, 2016
Push plugin breaking while building so these changes are done by following this thread issue
Telerik-Verified-Plugins#71
@jacksonkr
Copy link

if ([self.webView isKindOfClass:[UIWebView class]]) {
	[(UIWebView*)self.webView stringByEvaluatingJavaScriptFromString:jsCallBack];
}

http://stackoverflow.com/a/34901862/332578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests