0

Getting errors in XCode for the following code within a Cordova plugin for Meteor 1.2:

PhoneRTCPlugin.swift
override init(webView: UIWebView) {
<code...>
super.init(webView: webView)
}

The errors are: Cannot override 'init' which as been marked unavailable 'init(webView:)' is unavailable: Deprecated in Cordova 3.9.2. Use plugininitialize method instead.

Thanks for your help.

1 Answer 1

2

It tells you that init(webView: UIWebView) isn't available because it was deprecated, use pluginInitialize instead

override func pluginInitialize() {
   peerConnectionFactory = RTCPeerConnectionFactory()
   RTCPeerConnectionFactory.initializeSSL()
}
6
  • Thanks VERY much for your help with this, hope we can get it resolved. Unfortunately, when I try the code that you've included, I get two errors: on the override pluginInitialize like I get the error 'Consecutive declarations on a line must be separately by ;' and on the line that starts the class I get 'Class XXX has no initializers'. Thanks again. Nov 26, 2015 at 14:57
  • sorry, I forgot the func part, I've never developed a plugin with swift, try again with the edit. Anyway, init(webView:) isn't removed yet, it will be removed on cordova ios 4 that hasn't been released yet, not sure which version meteor uses Nov 26, 2015 at 16:00
  • Thanks again. That code does compile, but then I get another error, which is: Class PhoneRTCPlugin has no initializers. I tried adding: super.pluginInitialize(); but this didn't help. Nov 26, 2015 at 19:29
  • try adding an empty init function init() { println("Hello") } Nov 26, 2015 at 20:42
  • Unfortunately this did not remove the message Class PhoneRTCPlugin has no initializers. Do you know how to resolve this, or have examples to work from?? Thanks very much for your help. Much appreciated. Nov 27, 2015 at 1:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.