Sharepoint Framework Geolocation

%3CLINGO-SUB%20id%3D%22lingo-sub-75208%22%20slang%3D%22en-US%22%3ESharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75208%22%20slang%3D%22en-US%22%3E%3CP%3EI%20created%20today%20a%20simple%20webpart%20that%20uses%20the%20navigation%20object%20from%20the%20browser%20to%20take%20the%20current%20location%20of%20the%20user%20using%20coordinates%2C%20it%20works%20perfectly%20fine%20on%20the%20browser.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wanted%20to%20do%20this%20as%20a%20smal%20Proof%20of%20Concept%2C%20we%20have%20a%20customer%20that%20wants%20to%20create%20forms%20for%20their%20users%2C%20and%20those%20users%20will%20fill%20info%20on%20the%20field%2C%20but%20they%20want%20to%20track%20the%20location%20of%20the%20user.%20%26nbsp%3BThey%20will%20use%20mainly%20Android%20Phones.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20downloaded%20the%20Sharepoint%20App%2C%20and%20tried%20navigating%20to%20the%20page%20with%20the%20SPFx%20webpart%20that%20shows%20the%20location.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20says%2C%20denied%2C%20and%20Its%20obvious%2C%20the%20Android%20Sharepoint%20App%20itself%20never%20requested%20permissions%20to%20access%20location%20services.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPossible%20ways%20to%20fix%20this%3A%3C%2FP%3E%3CP%3E1.%20%26nbsp%3BAsk%20Sharepoint%20App%20devs%20if%20they%20can%20request%20location%20permissions%2C%20in%20this%20way%2C%20these%20kind%20of%20webparts%26nbsp%3Bwould%20work.%3C%2FP%3E%3CP%3E2.%20I%20tried%20on%20the%20Android%20OS%20settings%20to%20see%20if%20I%20could%20explicitly%20give%20permissions%20to%20that%20APP%20for%20location%20services%20and%20it%20doesnt%20seem%20possible.%3C%2FP%3E%3CP%3E2.%20Any%20other%20idea%3F%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5720%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F121%22%20target%3D%22_blank%22%3E%40Waldek%20Mastykarz%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20225px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15381iF791E5762F37452F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Screenshot_20170605-160118.png%22%20title%3D%22Screenshot_20170605-160118.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15382iDF2B64F9FB496CF7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22IMG_20170605_160157.jpg%22%20title%3D%22IMG_20170605_160157.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20wants%20to%20try%20this%3F%20I%20am%20open%20to%20share%20the%20code%20is%20very%20easy%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75979%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75979%22%20slang%3D%22en-US%22%3Ethat%20seems%20a%20good%20option!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75976%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75976%22%20slang%3D%22en-US%22%3E%3CP%3ETo%20add%20to%20my%20reply%20above%2C%20we%20could%20probably%20prompt%20users%20to%20turn%20on%20location%20sharing%20only%20when%20they%20load%20the%20page%20that%20contains%20such%20web%20parts%2C%20via%20web%20part's%20communication%20with%20native.%20Something%20we%20could%20look%20into.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAgain%2C%20thanks%20for%20reporting%20the%20issue!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6093%22%20target%3D%22_blank%22%3E%40Luis%20Esteban%20Valencia%3C%2FA%3E%20Munoz%20wrote%3A%3CBR%20%2F%3E%3CP%3EI%20created%20today%20a%20simple%20webpart%20that%20uses%20the%20navigation%20object%20from%20the%20browser%20to%20take%20the%20current%20location%20of%20the%20user%20using%20coordinates%2C%20it%20works%20perfectly%20fine%20on%20the%20browser.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20wanted%20to%20do%20this%20as%20a%20smal%20Proof%20of%20Concept%2C%20we%20have%20a%20customer%20that%20wants%20to%20create%20forms%20for%20their%20users%2C%20and%20those%20users%20will%20fill%20info%20on%20the%20field%2C%20but%20they%20want%20to%20track%20the%20location%20of%20the%20user.%20%26nbsp%3BThey%20will%20use%20mainly%20Android%20Phones.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20I%20downloaded%20the%20Sharepoint%20App%2C%20and%20tried%20navigating%20to%20the%20page%20with%20the%20SPFx%20webpart%20that%20shows%20the%20location.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20says%2C%20denied%2C%20and%20Its%20obvious%2C%20the%20Android%20Sharepoint%20App%20itself%20never%20requested%20permissions%20to%20access%20location%20services.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPossible%20ways%20to%20fix%20this%3A%3C%2FP%3E%0A%3CP%3E1.%20%26nbsp%3BAsk%20Sharepoint%20App%20devs%20if%20they%20can%20request%20location%20permissions%2C%20in%20this%20way%2C%20these%20kind%20of%20webparts%26nbsp%3Bwould%20work.%3C%2FP%3E%0A%3CP%3E2.%20I%20tried%20on%20the%20Android%20OS%20settings%20to%20see%20if%20I%20could%20explicitly%20give%20permissions%20to%20that%20APP%20for%20location%20services%20and%20it%20doesnt%20seem%20possible.%3C%2FP%3E%0A%3CP%3E2.%20Any%20other%20idea%3F%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5720%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F121%22%20target%3D%22_blank%22%3E%40Waldek%20Mastykarz%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20225px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15381iF791E5762F37452F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Screenshot_20170605-160118.png%22%20title%3D%22Screenshot_20170605-160118.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15382iDF2B64F9FB496CF7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22IMG_20170605_160157.jpg%22%20title%3D%22IMG_20170605_160157.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnyone%20wants%20to%20try%20this%3F%20I%20am%20open%20to%20share%20the%20code%20is%20very%20easy%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%3C%2FP%3E%0A%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75973%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75973%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20feedback%20Luis!%20It's%20a%20very%20fair%20ask%20and%20sorry%20for%20not%20keeping%20close%20track%20of%20the%20web%20part%20features%20that%20require%20certain%20mobile%20capabilities.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20might%20be%20a%20little%20bit%20tricky%20from%20experience%20point%20of%20view%20to%20request%20location%20information%20upfront%20just%20for%20the%20relatively%20slim%20possibility%20of%20running%20certain%20location-needed%20web%20parts%20(say%2C%20majority%20of%20users%20dont%20actually%20interact%20with%20such%20web%20parts%20in%20the%20SharePoint%20mobile%20app).%20We%20will%20take%20the%20request%20and%20update%20the%20thread%20if%20we%20come%20up%20with%20a%20good%20solution%20and%20timeline%20for%20this.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ecc%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F11843%22%20target%3D%22_blank%22%3E%40Nate%20Clinton%3C%2FA%3E%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F31057%22%20target%3D%22_blank%22%3E%40Aneetha%20Jayaraman%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75963%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75963%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20adding%20this%20to%20the%20UserVoice!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75388%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75388%22%20slang%3D%22en-US%22%3EThanks%20Waldek.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20just%20created%20the%20suggestion%20here%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fsharepoint.uservoice.com%2Fforums%2F329220-sharepoint-dev-platform%2Fsuggestions%2F19512391-geolocation-services-on-sharepoint-app-for-mobile%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsharepoint.uservoice.com%2Fforums%2F329220-sharepoint-dev-platform%2Fsuggestions%2F19512391-geolocation-services-on-sharepoint-app-for-mobile%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-75291%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20Framework%20Geolocation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-75291%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20a%20great%20suggestion%20but%20one%20that%20I'm%20afraid%20you%20can't%20do%20much%20about%20yourself.%20As%20you've%20noticed%2C%20the%20SharePoint%20app%20would%20have%20to%20have%20permissions%20to%20access%20location%20services%20on%20your%20device%2C%20and%20even%20then%20the%20question%20is%20if%20it%20could%20relay%20these%20permissions%20to%20the%20browser%20control%20it%20uses%20to%20display%20web%20pages.%20I'd%20say%20it's%20definitely%20something%20for%20the%20engineering%20team%20to%20have%20a%20look%20at.%20Have%20you%20considered%20submitting%20a%20UserVoice%20entry%20with%20the%20idea%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Deleted
Not applicable

I created today a simple webpart that uses the navigation object from the browser to take the current location of the user using coordinates, it works perfectly fine on the browser.

 

I wanted to do this as a smal Proof of Concept, we have a customer that wants to create forms for their users, and those users will fill info on the field, but they want to track the location of the user.  They will use mainly Android Phones.

 

So I downloaded the Sharepoint App, and tried navigating to the page with the SPFx webpart that shows the location.

 

It says, denied, and Its obvious, the Android Sharepoint App itself never requested permissions to access location services.

 

 

Possible ways to fix this:

1.  Ask Sharepoint App devs if they can request location permissions, in this way, these kind of webparts would work.

2. I tried on the Android OS settings to see if I could explicitly give permissions to that APP for location services and it doesnt seem possible.

2. Any other idea?

@Vesa Juvonen 

@Waldek Mastykarz

 

Screenshot_20170605-160118.pngIMG_20170605_160157.jpg

 

Anyone wants to try this? I am open to share the code is very easy,

 

Thanks

6 Replies
Highlighted

It's a great suggestion but one that I'm afraid you can't do much about yourself. As you've noticed, the SharePoint app would have to have permissions to access location services on your device, and even then the question is if it could relay these permissions to the browser control it uses to display web pages. I'd say it's definitely something for the engineering team to have a look at. Have you considered submitting a UserVoice entry with the idea?

Highlighted
Highlighted

Thanks for adding this to the UserVoice! 

Highlighted

Thanks for the feedback Luis! It's a very fair ask and sorry for not keeping close track of the web part features that require certain mobile capabilities. 

 

It might be a little bit tricky from experience point of view to request location information upfront just for the relatively slim possibility of running certain location-needed web parts (say, majority of users dont actually interact with such web parts in the SharePoint mobile app). We will take the request and update the thread if we come up with a good solution and timeline for this. 

 

cc:

@Nate Clinton@Aneetha Jayaraman

Highlighted

To add to my reply above, we could probably prompt users to turn on location sharing only when they load the page that contains such web parts, via web part's communication with native. Something we could look into. 

 

Again, thanks for reporting the issue!

 

 


@Luis Esteban Valencia Munoz wrote:

I created today a simple webpart that uses the navigation object from the browser to take the current location of the user using coordinates, it works perfectly fine on the browser.

 

I wanted to do this as a smal Proof of Concept, we have a customer that wants to create forms for their users, and those users will fill info on the field, but they want to track the location of the user.  They will use mainly Android Phones.

 

So I downloaded the Sharepoint App, and tried navigating to the page with the SPFx webpart that shows the location.

 

It says, denied, and Its obvious, the Android Sharepoint App itself never requested permissions to access location services.

 

 

Possible ways to fix this:

1.  Ask Sharepoint App devs if they can request location permissions, in this way, these kind of webparts would work.

2. I tried on the Android OS settings to see if I could explicitly give permissions to that APP for location services and it doesnt seem possible.

2. Any other idea?

@Vesa Juvonen 

@Waldek Mastykarz

 

Screenshot_20170605-160118.pngIMG_20170605_160157.jpg

 

Anyone wants to try this? I am open to share the code is very easy,

 

Thanks


 

Highlighted
that seems a good option!