New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to fetch Location on VIVO Devices #255
Comments
did you find any solution? |
facing the same issue from the last 2-3 days, Does anyone knows how to fix it? previously it was working fine.????? |
Most likely will be fixed when #250 is fully released. If you could test the development version of the plugin and provide feedback, that would be great. cordova plugin remove cordova-plugin-geolocation
cordova plugin add https://github.com/apache/cordova-plugin-geolocation.git Just a reminder that development versions haven't been voted on or tested for release, so the build should not be used in production environments. |
yes till now (already 1 week), i have the same problem, not only vivo devices but also oppo, |
We used the plugin from github just like you indicated but still can't get the location. |
yes, we have installed this plugin, the location application is still not found, const options = {
enableHighAccuracy: true,
timeout: 5000,
maxAge: 0
};
function success(pos) {
const crd = pos. coords;
console. log('Your current position is:');
console. log(`Latitude : ${crd. latitude}`);
console. log(`Longitude: ${crd. longitude}`);
console. log(`More or less ${crd. accuracy} meters.`);
}
function error(err) {
console. warn(`ERROR(${err. code}): ${err. message}`);
}
navigator. geolocation. getCurrentPosition(success, error, options); is there a problem in webview cordova for vivo/oppo devices? |
facing the same issue from the last 2-3 days, Does anyone knows how to fix it? previously it was working fine.????? |
facing geolocation fetch problem from past 3-4 days for Vivo device Funtouch(Android 12) OS, anyone have solution for this? |
i am also facing the same issue last 2-3 days previously it was working fine. "cordova-plugin-geolocation": "^4.1.0", |
same problem did you find the solution |
Here is what I know and don't know... I do not know if there are device-specific issues. There is an issue on Android 12 devices regarding geolocation via the webview, which is still an open issue. This is a webview bug, not something that Cordova can deal with directly. The bug has to do with attempting to request strictly coarse location. Effectively with this bug, #250 works around that issue by asserting that fine location is always enabled on Android 12+ devices, additionally it also treats both permission levels independent as now recommended by Android 12 location changes. Now, based on the comments so far, it seems like whatever has happened in the last 3-4 days as many pointed out so... this does not seem to be related to that issue. Cordova hasn't released anything that would have broken this runtime (#250 have been merged in, but it isn't released). Presumably these developers also haven't made any updates to their app that would have caused a difference in their geolocation code. With these assumptions, the only thing that can update and cause difference in behaviour in their app is the system webview, which was updated on Nov 14. Giving time to publish and end users to update their device with the latest version (107.0.5304.105), the timeline probably fits. What I would suggest is attempting to reproduce the issue with a stripped down sample application and raise an issue with Google Chromium team. They will expect an APK and the full source code of the reproduction app. |
We are also strugling with same issue majorly with OPPO, VIVO, REDMI, MI devices Also for few rare cases in OLD LG/MOTO smartphones. Onyone If you have found existing ticket or reported to Google, please share link here for refrence. EDIT: few Android 9+ device also reported same issue, and strage behavior, sometime its working, sometimes not. BUT for OPPO/VIVO its not working for once. |
What was the solution? , because we have already had no update in our app for the last 2-3 months, but |
@breautek We have been facing this same issue in OPPO, VIVO, REDMI, MI, OLD LG/MOTO Devices, Mostly having Android 12, If this issue is related with Android WebView even so, I tried downgrading and using the previous stable releases of it, but the issue still persists. Edit: I've also posted on google android support community regarding webview. |
I just wanted to add and make clear that this plugin doesn't actually implement any actual geolocation code for the android platform. What it does do is just handle the app permissions for geolocation. So assuming this issue is not a permission issue and the app has all the relevant permissions, the next logical step to troubleshoot is the geolocation implementation itself, which is not implemented by Cordova. |
I'm using this plugin instead: cordova.plugins.LocationProvider.getOwnPosition(param like w3C, successcallback, errorcallback) |
Found a workaround. Instead of using this plugin, can be fixed by writing custom plugin with native code (Location Manager or Fused Location). |
Can anyone share the repository of the custom plugin with the native code? We would like to test the same in our application. We are struggling with this issue in our application working for several thousand users.
From: jeeva ***@***.***>
Reply to: apache/cordova-plugin-geolocation ***@***.***>
Date: Thursday, 24 November 2022 at 10:05 AM
To: apache/cordova-plugin-geolocation ***@***.***>
Cc: ASHISH SHARMA ***@***.***>, Comment ***@***.***>
Subject: Re: [apache/cordova-plugin-geolocation] Unable to fetch Location on VIVO Devices (Issue #255)
Found a workaround. Instead of using this plugin, can be fixed by writing custom plugin with native code (Location Manager or Fused Location).
—
Reply to this email directly, view it on GitHub<#255 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKPRXN5PHUK4XNOO6D6ZSI3WJ3V4ZANCNFSM6AAAAAASGQFOLE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
I'm still working on it (Testing it on various devices). Once it completed. Will share it |
working with https://github.com/transistorsoft/cordova-background-geolocation-lt |
solved, works very well |
please share code if it working |
can you please share the code and changes you did |
This is paid plugin |
|
giving error at plugins.Locationprovider??? |
whether to use this plugin https://github.com/ToniKorin/cordova-plugin-location-provider.git |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi all, I'm working with cordova in a Quasar V1 project. This is the code used with this locationservices plugin:
I'm sorry not to confirm if the solution works or not, but with this app freeze issue I can't ask customers to test it. |
I am using IONIC application and using geolocation '@awesome-cordova-plugins/geolocation/ngx'. This was working fine but since last few days it stopped. I am trying now to use "cordova-plugin-locationservices" with cordova.plugins.locationServices.geolocation.getCurrentPosition(onSuccess, onError, options) but it is giving me "property locationServices does on exists on type CordovaPlugins". Kindly help. |
Are you using ionic. Can you please share your sample code and specially which Import module did you use for "cordova.plugins.locationServices" |
Tried the latest webview 107, beta webview 108, dev webview 109 - none of them solves the problem |
I am using IONIC and change "cordova-plugin-geolocation" to @capacitor/geolocation it working
|
You mean to say, to convert the ionic cordova project to ionic capacitor project ? I tried to add capacitor in my cordova project and it gives me error "SyntaxError: Unexpected token '('" in adb logcat. |
This solution doesn't work for devices that doesn't have Google Play Services like Huawei. I hope anyone could share any alternative that they could find. Thanks! |
Has anyone figured out what changes need to be made to the native code to avoid isues with geolocation? These 6-7 year old plugins, in a cordova application, just gave me compile problems, so I wasn't even able to test them. |
I used these links to install: But getting this error in the console tab on the browser, I am using IONIC 5 in my Mobile app Please help somebody, I struck for 2 days I tried so many things but nothing is working as expected. Advance thanks to all who are looking for a solution. |
google announce (Security and privacy) section for security reason google can't access [ACCESS_FINE_LOCATION] on some Android 12 Mobile. it access only ACCESS_COARSE_LOCATION. |
We have problems after Android updates on devices with Android 8.1.0, 11 and 12. With cordova-plugin-geolocation I have a timeout error (after 60 secs) in these devices. |
Hi Guys, I'm also suffering from this issue since few weeks ago.
It works for me. Hope it helps. My Environment is Angular+Ionic 4 with Cordova. I tried to install two of this plugin: in my ts file:
|
God knows, who in this entire ecosystem has screwed up, making everyone using these plugins, SUFFER.
any simple successful solution is highly appreciated.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Jason Tian ***@***.***>
Sent: Wednesday, November 30, 2022 9:07:48 AM
To: apache/cordova-plugin-geolocation ***@***.***>
Cc: ASHISH SHARMA ***@***.***>; Comment ***@***.***>
Subject: Re: [apache/cordova-plugin-geolocation] Unable to fetch Location on VIVO Devices (Issue #255)
Hi Guys, I'm also suffering from this issue since few weeks ago.
After doing some research, i try to combine several methods by solving this issue. In summary:
1. Go to google play and update user mobile to latest android web view version.
2. Install LocationProvider cordova plugin (use ts-ignore to prevent ionic build error)
3. enable timeout option on geolocation, and try use LocationProvider if geolocation has failed.
It works for me. Hope it helps.
My Environment is Angular+Ionic 4 with Cordova.
I tried to install two of this plugin:
cordova-plugin-geolocation 4.1.0 "Geolocation"
cordova-plugin-location-provider 1.5.4 "LocationProvider"
in my ts file:
import { Geolocation, GeolocationOptions } from ***@***.***/geolocation';
import { Platform } from ***@***.***/angular';
//dependency injection
constructor(private geolocation: Geolocation, private platform: Platform){}
somefunction(){
this.geolocation.getCurrentPosition({ maximumAge: 3000, timeout: 5000, enableHighAccuracy: false }).then((resp) => {
//do something
}).catch((error) => {
//can use platform to do platfom specific code here
***@***.***
cordova.plugins.LocationProvider.getOwnPosition({ maximumAge: 3000, timeout: 5000, enableHighAccuracy: false },(resp)=>{
//do something
}, (error)=>{
//do something
});
}
—
Reply to this email directly, view it on GitHub<#255 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKPRXN54HN3IOUUQCUBZIKLWK3DWHANCNFSM6AAAAAASGQFOLE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Seems like Android is playing games with IONIC and CORDOVA and making us inclined towards native technologies like Flutter. But mind you Android this is not the right way. Yes, any simple successful solution is highly appreciated, the users of the app are suffering because of these mess. |
Can anyone tell me where to report this issue with the latest Android updates? Because these updates are creating quite a few problems, several important frameworks are involved and so many days have gone by without finding a solution. |
I answer to myself: https://issuetracker.google.com/ |
I'm closing this issue because it doesn't appear to be related to Cordova. To recap, Cordova doesn't implement any actual geolocation features for the Android platform. What the Cordova plugin does do is handle geolocation permissions for the application, hooking into the Webview's geolocation implementation. So in otherwords, the geolocation feature is provided by the system webview itself. Because this issue does not appear to be a permissions related issue, there isn't anything Cordova can do to resolve this problem. Out of all the comments, the devices that is affected (Vivo, Oppo, Xioami, etc...). These devices often don't use standard AOSP software. I don't have access to any of these devices for testing, but the standard AOSP system webview appears to work as expected. And I know that some of these devices do not use, or uses a fork of the standard AOSP webview. Vivo for example has their own VivoBrowser that appears to be used based on the user agent. Unfortunately I do not have an answer of why this is happening on these specific devices, I just know that it's not something Cordova can correct. It's very likely an issue within their system webview implementation. As for potential workarounds, several developers have posted success utilizing an alternate geolocation plugin that uses the native APIs instead of the browser-based APIs that this Cordova plugin relies on. So that may be a path to consider. Cordova will not implement a native-based implementation as a workaround as there are many community plugins that does this already. |
It will be helpful if the issue is kept open to get more ideas and solution from people. |
I had the same issue on my Vivo x70, today there was some auto update on play services and then I did restart the phone and now the same App has started working with GPS location being captured properly. I am not sure exactly was auto updated today on my phone. Can anyone try to update the "Play Services" and then retry. As need to give solutions to the users who are facing the same issue.
|
how do you import it into your project? I found LocationServices.getCurrentPosition in: |
After Adding this plugin - cordova-plugin-locationservices-fix.Try this. |
Good day everyone! First, you have to follow the instruction on the documentation and get the API KEY from Google. Second, in
Third, under
Fourth, import the
That's it! Thanks |
Thanks for your answer How many mobiles have you tested this code on? |
There's an Android WebView update, but the issue persists with Oppo's and Vivo's devices |
We are testing this solution in Vivo, Samsung, Xiaomi, Huawei and OnePlus devices and from different Android API versions (9,10,11 and 12) |
The December 2 update Android System WebView works on both Android 8.1 and 12. If the update doesn't work, you'll need to remove and install Android System WebView. |
hello Thanks |
You can check the documentation here: Thanks |
Unable to fetch Location on VIVO Devices like V15 Pro and other models with Android Version 12. I am using cordova geoLocation plugin version 4.1.0. Please help me to Fix this issue. Thanks in Advance.
The text was updated successfully, but these errors were encountered: