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

iOS 9+ Location Request does nothing #6

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

Comments

Projects
None yet
4 participants
@WeetA34

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

This comment has been minimized.

Show comment
Hide comment
@Vednus

Vednus 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.

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

This comment has been minimized.

Show comment
Hide comment
@WeetA34

WeetA34 Feb 29, 2016

Hi Brainvise,

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

Rgds
Stéphane

WeetA34 commented Feb 29, 2016

Hi Brainvise,

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

Rgds
Stéphane

@Vednus

This comment has been minimized.

Show comment
Hide comment
@Vednus

Vednus Feb 29, 2016

Oh sorry. Need to take the time to read.

Vednus commented Feb 29, 2016

Oh sorry. Need to take the time to read.

@WeetA34

This comment has been minimized.

Show comment
Hide comment
@WeetA34

WeetA34 commented Feb 29, 2016

no pb :)

@nsndeck

This comment has been minimized.

Show comment
Hide comment
@nsndeck

nsndeck Apr 12, 2016

Contributor

Closed with commit #9

Contributor

nsndeck commented Apr 12, 2016

Closed with commit #9

@nsndeck nsndeck closed this Apr 12, 2016

@vswee

This comment has been minimized.

Show comment
Hide comment
@vswee

vswee Jan 10, 2017

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

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 join this conversation on GitHub. Already have an account? Sign in to comment