-
Hi, I need to resolve my PluginCall from another function, so I saved it through Bridge, and resolve it later, but I've message this message :
So this is a bit of my code, can you tell me guys where I'm wrong :
Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
mlynch
Jun 20, 2022
Replies: 1 comment 1 reply
-
There's no guarantee that Take a look at how the Geolocation plugin saves calls and reuses them: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
w-mazed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no guarantee that
getSavedCall
will return a non-nullPluginCall
so you should make sure it's not-null before using it.Take a look at how the Geolocation plugin saves calls and reuses them:
Retaining:
https://github.com/ionic-team/capacitor-plugins/blob/7563040983ad397e28616246e7ed5ffce69727c2/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java#L94
Storing:
https://github.com/ionic-team/capacitor-plugins/blob/7563040983ad397e28616246e7ed5ffce69727c2/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java#L165
Using:
https://github.com/ionic-team/capacitor-plugins/blob/7563040983ad397e28616246e7ed5ffce69…