question

TheBosZ avatar image
TheBosZ asked

Cordova Ads Plugin: iOS uses deprecated "writeJavascript"

I'm trying to integrate the Cordova plugin for Amazon Ads into my game to take advantage of the upcoming promotion.

Unfortunately, when I try to build for iOS, I get an error: "Plugins/com.amazon.mas.cpt.ads.AmazonMobileAdsPlugin/CDVAmazonMobileAds.m:316:11: No visible @interface for 'CDVAmazonMobileAds' declares the selector 'writeJavascript:'"

The file "CDVAmazonMobileAds.m" uses the deprecated (and removed) "writeJavascript" method.

My cordova is 6.2.0 and my iOS platform is 4.1.1. The plugin version is 1.0.0

Please fix the bug or tell me how to fix it.

Thanks!

mobile adsios
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Nick Gardner avatar image
Nick Gardner answered

I'll look into getting this reported to the team, but in the meantime, I found this stackoverflow answer which might help fixing the error: http://stackoverflow.com/questions/28850016/how-do-i-replace-the-deprecated-methods-tosuccesscallbackstring-and-writejavascr

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the answer!

I already tried changing it to use evalJs:

[self.commandDelegate evalJs: [NSString stringWithFormat:@"%@.fire('%@')", kPluginName, escapedEventString]];	

But it seems like the event isn't firing. At least my listeners are never called.

0 Likes 0 ·