bug: Can't access savePluginCall in iOS plugin
See original GitHub issueBug Report
Capacitor Version
Latest Dependencies:
@capacitor/cli: 2.4.6
@capacitor/core: 2.4.6
@capacitor/android: 2.4.6
@capacitor/electron: 2.4.6
@capacitor/ios: 2.4.6
Installed Dependencies:
@capacitor/cli 2.4.5
@capacitor/core 2.4.5
@capacitor/android 2.4.5
@capacitor/ios 2.4.5
@capacitor/electron not installed
Platform(s)
iOS
Current Behavior
On Android, when perfrorming async tasks, I can saveCall(call)
and then access a saved call using savedCall
.
On iOS, I can try to get a call with let call = self.bridge.getSavedCall(callbackId!)
, but self.bridge.savePluginCall(call)
is inaccessible due to protection level.
Expected Behavior
I expect to be able to save and retrieve plugin calls in iOS
Code Reproduction
No need, literally just create a new capacitor plugin project, and try to save / retrieve a call in iOS
Other Technical Details
npm --version
output:
npm: '6.14.4',
ares: '1.16.0',
brotli: '1.0.7',
cldr: '36.1',
icu: '66.1',
llhttp: '2.0.4',
modules: '83',
napi: '6',
nghttp2: '1.40.0',
node: '14.2.0',
openssl: '1.1.1g',
tz: '2019c',
unicode: '13.0',
uv: '1.37.0',
v8: '8.1.307.31-node.33',
zlib: '1.2.11'
node --version
output: v14.2.0
pod --version
output (iOS issues only): 1.8.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Bypass, remove, or rescan Audio Units plug-ins in Logic Pro ...
If you can't open Logic Pro or MainStage, remove the installer files for third-party Audio Units: Find the installed plug-in file on your...
Read more >iOS unable to find plugins, Android fine - xcode - Stack Overflow
In XCode, goto Build Phases -> open the Compiled Sources dropdown. Click + and add the missing plugin .m file that should be...
Read more >iOS Troubleshooting Guide | Capacitor Documentation
This guide attempts to document common iOS/Xcode issues with possible ... If still getting the "Plugin not implemented" error, make sure you don't...
Read more >Plugin doesn't support Xcode projects - Help - Apollo GraphQL
Error when configuring code generation in iOS app with SPM via Xcode: ... then ApolloCodeGenPlugin-Initialize, I get 2 logs in the Report ...
Read more >iOS 'Only one accessory can be used at a time' error - 9to5Mac
We're almost at the end of the iOS 14 cycle but there's a bug that ... iPhone to their cars, sometimes they get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So it looks like there are several issues at play here:
getSavedCall
on the plugin has been deprecated because a) it duplicated behavior and b) it was only a single property and could get overwritten.getSavedCall
on the bridge in iOS may not be working correctly.As to the last item, when are you calling
getSavedCall()
?save()
onCAPluginCall
sets a flag to store it later, but that doesn’t actually happen until the plugin method returns. So it should work when it is called from an async method in the future but it won’t work immediately after callingsave()
.In the meantime, you can simply keep the call in a local property instead of relying on the built-in machinery. That’s not ideal but it should work in most situations while things get sorted out.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.