Closed thomas1511 closed 5 years ago
what's capacitor version?
"@capacitor/cli": "^1.0.0-beta.25",
"@capacitor/core": "^1.0.0-beta.25",
"@capacitor/ios": "^1.0.0-beta.25",
hum something may have broken, can you try on beta24?
I just rolled back to beta.24. The errors remain:
/node_modules/capacitor-fcm/ios/Plugin/Plugin/Plugin.swift:25:50: Extra argument 'toTopic' in call
/node_modules/capacitor-fcm/ios/Plugin/Plugin/Plugin.swift:40:54: Extra argument 'fromTopic' in call
/node_modules/capacitor-fcm/ios/Plugin/Plugin/Plugin.swift:52:20: Static member 'instanceID' cannot be used on instance of type 'InstanceID'
weirdo, I just deployed an app which uses that version. will double check this issue at weekend.
update: no luck, if anyone has a good way to reproduce this problem, I can try to help.
added a demo app
I'm having the same issue. I'm using Capacitor v1.1.0
In regards to the error Static member 'instanceID' cannot be used on instance of type 'InstanceID'
For me, this was caused by out of date pod dependancies. I needed up run pod update
to install the latest pods which fixed the error.
cd ios/App
pod update
I can then compile the app.
Yes. npx cap sync ios
also does pod install. Remember to always run it after installing any plugin via npm install.
When using capacitor-fcm in my project Xcode shows me the following error when building the application: "extra argument 'toTopic' in call";
this occurs in the following function:
@objc func subscribeTo(_ call: CAPPluginCall) { let topicName = call.getString("topic") ?? "" Messaging.messaging().subscribe(toTopic: topicName) { error in // print("Subscribed to weather topic") if ((error) != nil) { print("ERROR while trying to subscribe topic \(topicName)") call.error("Can't subscribe to topic \(topicName)") }else{ call.success([ "message": "subscribed to topic \(topicName)" ]) } } }
(the same error is received at the unsubscribe call).
the last issue here is the getToken() function:
InstanceID.instanceID().instanceID { (result, error) in
provides the error: 'Static member 'instanceID' cannot be used on instance of type 'InstanceID'"