-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Geolocation not working on MIUI 8 (Xiaomi mi5s) #1703
Comments
I must add that I'm not completely sure if the problem is with MIUI 8 or with Android 6... |
Update your dependencies to theirs latest releases and try it again. |
@danielsogl What do you recommend me for that? Should I run npm install in my project folder? I think they are in their latest releases, but I don't really know |
Updated @ionic-native/geolocation to the version 3.12.1, works the same in navigator, but still having the same problem in my Xiaomi. Any ideas? |
Check out the latest ionic release notes for release 4.3.x. The latest release for ionic native packages are 3.12.x |
Used npm update, then npm install. Now my whole project is dead and ionic serve won't work. I'm trying to fix this up and then try to get back into upgrading the depedencies individually, but now, I'm in a dead point. Will update as soon as I get the project fixed. NPM should get its shit together with the dependencies management... |
@danielsogl Updating the dependencies didn't work. Now my project is properly migrated to the latest version of each peer dependency, and everything works fine, except for the geolocation thingy. I tried many things, I'm even monitoring the device and could locate the problem: both cordova navigator geolocation plugin, and ionic-native/Geolocation, fail delivering a response. They just throw error 3 always: timeout, and after some time, they reply with the position. Is taking usually 3-4 mins for that reply. At the moment, it only happens to my Xiaomi mi5s (MIUI 8, Android 6), but it may happen in other devices. Tried everything, even disabling the high precission, but I can't still get a good location, though other apps do it correctly (tried with JustEat and Google Maps). Do you know what may be happening? PD: It works perfectly in a Samsung S5 and the browser. Thank you! |
@Zerokk |
Looks like an issue with the plugin, and not with the Ionic Native wrapper. I'm going to close this issue but feel free to keep the conversation going. To verify that it's not an Ionic Native issue, please run the following command and compare the behaviour with the one you experienced earlier: import { Geolocation } from '@ionic-native/geolocation';
...
// run this somewhere in your code
Geolocation.getPlugin().getCurrentPosition(x => console.log('Success', x), e => console.log('Error', e)); |
@ihadeed I don't get any response from that snippet. It's just as with the normal one: it just gets a lot of time to get a response from the GPS. @stormwin I can't find any thread that talks about it; I'm thinking in posting the bug by myself. Do you know if there's a discussion about this topic? They should release an update if it's a ROM problem. Anyways, geolocation works good for you? Don't you know if there can be any workaround to fix this? I'm beginning to think that Cordova is not suitable for proper GPS functioning, as many people say... I don't feel any comfortable knowing that my app doesn't work in 1 out of 2 devices I tried this far. |
I am facing the same issue with my Redmi Note 4. Did you find any solution to the problem? |
Actually not, it seems to be a widespread problem...
El 5 oct. 2017 12:45 p. m., "Karan Sharma" <notifications@github.com>
escribió:
… I am facing the same issue with my Redmi Note 4. Did you find any solution
to the problem?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1703 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKM8EQrUwddxwr6Dg5WBGsIe-c6SgQZqks5spLMzgaJpZM4N-InX>
.
|
So what can be done? Actually it worked fine in my Redmi some days back. IDK what happened now. Any workaround?? |
None. I just could not fix this and in fact, it posed a problem to my app,
and I'm still waiting Xiaomi and/or Cordova to put a fix. This should be
more observed by the Ionic team and help putting pressure so this gets
fixed for everyone.
El 5 oct. 2017 12:53 p. m., "Karan Sharma" <notifications@github.com>
escribió:
… So what can be done? Actually it worked fine in my Redmi some days back.
IDK what happened now. Any workaround??
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1703 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKM8Ef3Ny8YVmbf7tZVjl5Vrnv6H4ML2ks5spLUQgaJpZM4N-InX>
.
|
I am having the same issue with note 4. I had it earlier but an MIUI update fixed it. But the latest update broke it again. Its not a problem with ionic wrapper so its not going to be solved here. |
I am having the same issue with Redmi Note 4. |
It is a cordova plugin issue. But I dont think its going to be fixed from their side. Background geolocation plugin do work. But the plugin 5 times heavier . |
I am also facing same issue in redmi MIUI 8. but working fine woth redmi note 3. but not working in redmi 4 and note 4. |
I expected it to be rectified on MiUI9 but it was not. So I eventually decided to look for other plugins. And google maps plugin did a much better job. It was faster and offered google play services . But its heavy. I needed maps too so I decided to go with it. |
@Zerokk, Your package.json exposes your API Keys, hope you've changed them by now. |
Please help, Mobile Handset | Android Version | Status (current location shows)Moto G4 Plus | Android 7.0 | WORKING |
@rajeevriitm I am curious about you mentioning that the google maps plugin using the getMyLocation() is performing better. Did you have any problems using that? Can I just use that function and not any of ther other google maps functions which I don't need? |
@dmastag I am yet to face any problem . I did make a pull request to use getMyLocation to work without loading map. But I havent tested on many phones. Would be happy to see it tested on many phones. You can check the latest commit but I dont think documentation is ready yet. |
@Spanchal21 I think it might be a MIUI issue? Same app works on a samsung galaxy 5. |
I am having the same issue too with Redmi Note 4, Android 7, MIUI 9. Android Emulator with Nexus 5 is also returning nothing. I have all the dependencies updated. With Moto G4 Plus, ionic serve and iOS it is working fine. I will test it on other devices soon. |
test on Redmi note 4 | Android 7 |
5 years have passed but the problem is still persistent not working with mi devices. Sometimes it works and sometimes not. Any solutions? |
I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
Current behavior:
When I try to get my current position, the device just takes a really long time (2-3 minutes) to get it, while Google Maps itself works pretty nice. Works great on a Samsung S5, but... why not in my Xiaomi device?
Expected behavior:
Should get the current position really quick, as it does with other apps.
Steps to reproduce:
It stops for so long time, at this particular line:
this.geolocation.getCurrentPosition().then((position) => {
-->
Related code:
insert any relevant code here
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
global packages:
local packages:
System:
package.json:
The text was updated successfully, but these errors were encountered: