Coder Social home page Coder Social logo

Comments (5)

dpa99c avatar dpa99c commented on May 24, 2024

Runtime location authorization was introduced in iOS 8 (see here) hence the error on iOS 7.

from cordova-diagnostic-plugin.

s2young avatar s2young commented on May 24, 2024

Ah, OK. I must have missed this in the docs? How do I go about getting location on iOS7? Just ask via getCurrentPosition?

from cordova-diagnostic-plugin.

dpa99c avatar dpa99c commented on May 24, 2024

I will add a fix to the plugin for this. In the meantime, you could just use the device plugin to detect an omit the call on iOS 7 and below:

if(device.platform == "iOS" && parseInt(device.version) > 7){
    cordova.plugins.diagnostic.requestLocationAuthorization();
}

from cordova-diagnostic-plugin.

s2young avatar s2young commented on May 24, 2024

Yes, indeed. The fix was to simply go straight to the geolocation plugin's getCurrentPosition method. Thanks for your help.

from cordova-diagnostic-plugin.

dpa99c avatar dpa99c commented on May 24, 2024

Glad you found a workaround. Still, the plugin should not raise an error because of this, so I have added a patch to ensure requestLocationAuthorization is not called on iOS 7 or below, in commit f09c050. Since I'm using the latest Xcode 7, I don't have an iOS 7 simulator available and I don't have a device running iOS 7 so I'm unable to test it, so would appreciate if you could test this patch on iOS 7 by installing the plugin directly from this repo:

cordova plugin add https://github.com/dpa99c/cordova-diagnostic-plugin

It should no longer cause an error if requestLocationAuthorization is called on iOS 7, however it will still have no effect since requesting authorization is not needed on iOS 7.

from cordova-diagnostic-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.