function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gargi ManjeeGargi Manjee 

navigator.geolocation.getCurrentPosition using vf not working for Salesforce1

Dear All,

I have created global action with VF and Controller to get users current location.
It is working fine on web (laptop) but the same code is not working in android.

Kindly help.
Best Answer chosen by Gargi Manjee
Gargi ManjeeGargi Manjee
Thank you everyone for all the answers.
The issue was 'highaccuracy' option was not selected on the device and whereas I was passing highaccuracy = true while calling navigator.geolocation.getCurrentPosition function.

All Answers

VinayVinay (Salesforce Developers) 
Hi Gargi,

Make sure Location Services are enabled on your device.

Thanks,
Gargi ManjeeGargi Manjee
Hi Vinay,

Thank you for your reply. Yes I have enabled for both Salesforce1 as well as chrome (to confirm if it is not only limited to app) on my Andriod phone.
What else could be the reason?

Regards,
laisek aseaalaisek aseaa

This thing to behave or to display distinct styles primarily based at the box in which this aspect is proven. (Web primarily based Community vs Mobile publisher network you can visit here gamingexpert.net (https://www.gamingexpert.net/) ) Is there a manner to know that my community is regarded on a browser or on the Mobile Publisher container ? I was thinking if there’s a international attribute
Gargi ManjeeGargi Manjee
Thank you everyone for all the answers.
The issue was 'highaccuracy' option was not selected on the device and whereas I was passing highaccuracy = true while calling navigator.geolocation.getCurrentPosition function.
This was selected as the best answer
Indi RossIndi Ross
I have created a Visualforce global publisher action with the intent to add it to the Chatter actions menu for several objects in the organization. The action should be able to post a message directly to the feed of whatever Chatter feed it is added to. This is pretty easy, provided that I have the current record Id. However, I don't see how to generically get the current record Id from within the context of the Visualforce page.

I know that this is possible if I create a separate Visualforce page for every single object that I wish to use the action for and then create an object-specific publisher action for each one. But what a lot of clutter for something so simple! (Web-primarily based Community vs Mobile publisher network you can visit here - PC Build (https://thepcbuild.net/).

Is there any way to get the current record Id from within a global Visualforce publisher action? Hacks are welcome!
Aleem IqbalAleem Iqbal
I am planning to use this for my community which is protechreviewer.com (https://www.protechreviewer.com/).
I hope this will help to get better geolocation of visitors
David RutherDavid Ruther
Definitely, it is worth using in my community known as https://idealcpu.com/ to better understand users
Kolisha sertKolisha sert
Obviously, this is really good one, for better understanding my community is https://www.alltechloaded.com (https://www.alltechloaded.com/)/ so hopefully, this can fix ASAP, you can use it.
neil Perryneil Perry
I already use this on https://gamingredux.com/. You just have to make sure that you have the location services turned on.