Open
Description
using the plugin-geolocation in android with solid, I had a problem with the watchPosition function, that never returns the channel id.
in the Js code I Find that thea wait in in the invoke function never ends.
async function watchPosition(options: PositionOptions, cb: (location: Position | null, error?: string) => void) {
const channel = new core.Channel();
channel.onmessage = (message) => {
if (typeof message === 'string') {
cb(null, message);
}
else{
cb(message);
}
};
await core.invoke('plugin:geolocation|watch_position', {
options,
channel
});
return channel.id;
}
so I """"fix It"""" just removing the await of the invoke function, and works well, but I thing the problem in the rust code.
async function watchPosition(options: PositionOptions, cb: (location: Position | null, error?: string) => void) {
const channel = new core.Channel();
channel.onmessage = (message) => {
if (typeof message === 'string') {
cb(null, message);
}
else{
cb(message);
}
};
core.invoke('plugin:geolocation|watch_position', {
options,
channel
});
return channel.id;
}