Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8405809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:55:40+00:00 2026-06-09T22:55:40+00:00

I am developing iPad application using phonegap (cordova 1.9.0). I need to get current

  • 0

I am developing iPad application using phonegap (cordova 1.9.0). I need to get current position of the user.
I used following code and it works fine when Location services are enabled.

function onDeviceReady() {  
 navigator.geolocation.getCurrentPosition(onSuccess, onError);   
 }

function onSuccess(position) {
 console.log(position.coords.latitude + "-" + position.coords.longitude);
}

  function onError(error) {   
     alert('code: '    + error.code           
      'message: ' + error.message + '\n');  
  }

My problem is that this code not working when Location services are disabled. I need to get current location if Location service are enabled or disabled.

Anyone tell me how to get current location in this situtation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:55:41+00:00Added an answer on June 9, 2026 at 10:55 pm

    You can’t get the current location when location services are disabled. That would be a violation of a user’s privacy. The point of disabling location services on a device is to prevent applications from getting the current location.

    What I’ve done is display my own dialog with a lengthy explanation of why I need location services before calling getCurrentPosition(). I explain that the app won’t work without it. I also say something like:

    Your device may also ask you for permission.

    This increases the chances of someone saying yes to the iPhone dialog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an iPad application using sdk 5 and storyboard. I´m following the
We are considering using PhoneGap for an iPad application that we are developing. We
I'm developing iPad application I need to integrate third party project(Source code) with my
I am developing an iPad application by which i am using image context to
I am developing an iPad application in which I need a table view (
I am developing an iPad application using sdk 5 and storyboard from an already
I am new in ios development.Now,i am developing an Ipad application using ios 4.2
I am developing for iPad and have created a standard UISplitViewController application using the
I am developing an application for iPad. In this, I am using two UIScrollView
im developing and iPad & Android Application , which is used for Presentation purpose.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.