Contrary is OK : Geoloc is ON , and try to turn it OFF after my APP has been previously launched , then I receive an error 3 = PositionError.TIMEOUT which is correct .
Can you please answer for my first example ? and tell me how to solve this ?
best regards
- 16 Posts
- 0 Reply Likes
Posted 5 years ago
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
since this is your first "real" post and you are not familiar with GPS. I will try to keep this simple.
GPS is not reliable. This means just because you turn on a switch, it does not mean that GPS is going to work. There are a variety of reasons for this. The Link I gave you has a variety of reasons for this.
This means you MUST deduce the reason(s) why your GPS is failing. It could be a programmatic reason, or it could a reason stated on the list.
This also means, if this is your first app, you have a very difficult task. I would also say, if this is your first hybrid app - you should try sometime else, something simpler.
You have three options,
1) something simpler
2) work with a know working example.
3) Try to fix your App.
Let me know which you want to try.
Jesse
- 16 Posts
- 0 Reply Likes
The problem is not from GPS !
Let me ask my question in a different way :
Is there a way to check if geolocation is enabled or not in the customer's mobile and especially detect the change state in my APP ?
then if I can test that , I will have an answer at my above question?
Because now when I change the geolocation state when my app is running , turning it from OFF to ON , the geolocation error is still the same = PositionError.PERMISSION_DENIED. so I canno't detect the geolocation turned ON .
It's a matter of software problem , not GPS position or whatever is in your list.
So definitly my question is option 3 .
regards and thanks for your help
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
If your app has been on the App stores for three years, you should have stated so. I looked at your screen. You have not indicators to say you GPS is working or not. How did you deduce the GPS is not working?
FWIW: Alot has changed in three years. You are no longer allowed calls to remote servers without implementing the whitelist. This might be your issue.
Also, Is your target platform Android 6 or iOS 9? Neither is supported with *Phonegap Build* -- YET.
Is there a way to check if geolocation is enabled or not in the customer's mobile and especially detect the change state in my APP ?
No. If you do not get permission at install time, you will not get permission to install the app. So, if you app is installed, you will have permission to use the GPS.
If you get a
PositionError.PERMISSION_DENIED, this is an error you must handle - by assuming the user gave you permission to use GPS at install time.
Okay, We are making head way. From what you are saying, I think your option will #2.
Jesse
- 16 Posts
- 0 Reply Likes
- 4 Posts
- 0 Reply Likes
If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified).
If `timeout` parameter is not specified then no callback is called.
this is from readme(line 213). so now we only get timeout error rather then permission_denied error. If i'm wrong please correct me.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
This should have alarmed you:
geoloc if OFF , I launch my APP , I get an error 1 = PositionError.PERMISSION_DENIED as expected . Then I turn my geoloc ON (still with my APP running) , I try to check again , and still get error 1 ... whicj is now wrong .
Contrary is OK : Geoloc is ON , and try to turn it OFF after my APP has been previously launched , then I receive an error 3 = PositionError.TIMEOUT which is correct .
Do you notice the two different error cases?
In scenario ON->OFF, the general permission is still there! Android will not pass a value, though (time out, not permission denied)
- 16 Posts
- 0 Reply Likes
I was thinking to make my app restart , in order to detect geoloc state change...
I don't see any other solution
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
ask the user to turn on the GPS. Users do NOT generally turn off the GPS when an app is running. In addition, because of NEW background requirements, restarting may be your only other option.
SEE: HEADS UP: Android 6.0 SDK-23 blocks background operations.
This is a decision you must make.
Jesse
- 16 Posts
- 0 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
Like I said, your decision. FWIW you can file a bug report here. Note, you must create an account to file a bug report.
If you need help filing the report, let me know.
Jesse
- 16 Posts
- 0 Reply Likes
this is the way to detect geolocation state change.
Then everything is working correctly .
waiting for a fix one of these days ...
thanks to all
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
waiting for a fix one of these daysWhat do you want fixed? It ain't broke, and if it was, it would be an Android problem, not a Phonegap problem.
I just pictured your perception of the situation as in:
A car driver reaches the point where the road is interrupted by an opened bridge. Instead of waiting for the bridge to be closed, he keeps on driving and, of course, tumbles off the road and into the water.
One day later he complains with the car manufacturer and demands a solution. The manufacturer replies: it is not a bug in the car. It is a feature by design...when the bridge is opened, cars are supposed to wait until the ship has passed and the bridge is closed again. It's the road manager who is responsible for the implementation of this feature, years ago.
Mumbles the car owner: OK. I'll use my brakes from now on, until this nasty bug gets fixed one of these days."
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
if you don't report this, it will never get a fix. Do you want to wait until someone else reports it?
@Petra,
I also see this as a minor item, but I think Sandro has a valid point. I'm willing to help get this bug report started.
Jesse
- 16 Posts
- 0 Reply Likes
I've looked at your report link ... too complicated for me ... I'm french and don't understand where to start . I ve signed up , but which desk ? I don't see build pnonegap ... sorry
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
How to create a Cordova Bug Report on JIRA
Jesse
- 16 Posts
- 0 Reply Likes
I think it's OK , could you please check ?
https://issues.apache.org/jira/browse...
thank you
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
Looks good. However, I expect they will want to ask a few questions.
But since you asked for a definite feature, I think the response will be good.
Thanks for fill out the form. I will follow it after you have answer any questions they have. Also, I left a comment, which means I will get an email (and you should also) after someone reviews the report.
Jesse
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
After all, if you're using the latest cordova-plugin-geolocation@2.0.0 with PGB cli-5.2.0, you're most likely not getting a proper answer/result.
After all, cordova-plugin-geolocation@2.0.0 requires Cordova Android 5.x, which is not included in PGB cli-5.2.0
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
Cordova Android 5.0.0, which Petra speaks of, was released in Nov of 2015, and is ONLY available for CLI.
The trail of releases is as such:
The latest Cordova/Phonegap Tool Release is 5.4.1. It is pinned to Cordova Android: ~4.1.0 (4.1.1), even though Cordova Android 5.0.0 was release a few weeks before the 5.4.1 Tool Release.
Sorry, if this is confusing, but the releases are not linear and not well organized.
Jesse
- 4 Posts
- 0 Reply Likes
If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified).
If `timeout` parameter is not specified then no callback is called.
this is from readme(line 213). so now we only get timeout error rather then permission_denied error
their is this plugin this may help
https://www.npmjs.com/package/cordova...
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers
-
Plugins
- 1283 Conversations
- 38 Followers




Sandro Di Bernardi
Sandro Di Bernardi