Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

iOS 9+ Location Request does nothing #6

Closed
WeetA34 opened this issue Jan 30, 2016 · 6 comments
Closed

iOS 9+ Location Request does nothing #6

WeetA34 opened this issue Jan 30, 2016 · 6 comments

Comments

@WeetA34
Copy link

WeetA34 commented Jan 30, 2016

Hi

enableLocationRequest function does nothing when called on iOS 9+.
As i'm a NativeScript beginner, i've spent multiple hours to understand where the problem was.
I've found it and is located in the following js file:
node_modules/nativescript-geolocation/nativescript-geolocation.ios.js
The Os Version test doesn't permit to match iOS 9+.
It can be corrected by something like the following:

 function enableLocationRequest(always) {
-    if (platformModule.device.osVersion.indexOf("8") === 0) {
+    var intOsVersionMajor = parseInt(platformModule.device.osVersion.split('.')[0]);
+    if (intOsVersionMajor >= 8) {

Regards
Stéphane

@Vednus
Copy link

Vednus commented Feb 29, 2016

I think this is the culprit: https://github.com/NativeScript/nativescript-geolocation/blob/master/source/nativescript-geolocation.ios.ts#L169 which is only checking for version 8 and not version 9. If you change that to also check for 9 or check for > 8, then you should be good.

@WeetA34
Copy link
Author

WeetA34 commented Feb 29, 2016

Hi Brainvise,

hummmm that's exactly what i explained in my comment :)
thx to confirm

Rgds
Stéphane

@Vednus
Copy link

Vednus commented Feb 29, 2016

Oh sorry. Need to take the time to read.

@WeetA34
Copy link
Author

WeetA34 commented Feb 29, 2016

no pb :)

@nsndeck
Copy link
Contributor

nsndeck commented Apr 12, 2016

Closed with commit #9

@nsndeck nsndeck closed this as completed Apr 12, 2016
@vswee
Copy link

vswee commented Jan 10, 2017

Can't seem to get iOS 10 to ask for location permission. Android asks on location function run.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants