[AC-4864] Callback not called in requestLocationPermissions on Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-03-27T18:39:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Debuisson Eugène |
Assignee | Shak Hossain |
Created | 2017-03-20T14:24:41.000+0000 |
Updated | 2018-03-06T07:47:55.000+0000 |
Description
Hello,
When I use Ti.Geolocation.requestLocationPermissions the callback is not called at all on Android. I tried to put Ti.API.error or alert in it but nothing happened.
Ti.Geolocation.requestLocationPermissions(Titanium.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
Ti.API.error('hello');
Ti.API.error(JSON.stringify(e));
});
}}
I'm using SDK 6.0.2 and building on Android.
Hello, AUTHORIZATION_ALWAYS is only for iOS and windows app. Not supported for Android. I can get the logs by the below code.
Location permissinon popup opens and allowing that gives this response.
Once the permission is granted later try would not show the permission popup and the log for click on the button. You need to remove the permission from settings. There seems to be no issue here. Thanks.
In the docs I saw requestLocationPermissions was for Android too but didn't check the authorization type. So I tried this: {noformat} Ti.Android.requestPermissions(["android.permission.ACCESS_FINE_LOCATION"], function(e) { alert('hey'); Ti.API.error(JSON.stringify(e)); }); {noformat} And put
Hello, Try this sample code as a workaround.
Hello, I tried that workaround but the callback isn't called.
Hello, Send the full code you are testing. The code I sent is working perfectly. It shows the success log. Thanks.
I tried it in a new project.
Hello, Are you using my code? use the below code
Callback only calls on first run on device. After you grant the access the callback calls and window opens. If you remove the permission from setting it should call again. Make sure you set
in tiapp.xml. Thanks.
Hello, This code works for me ! Thanks !
The above code does not work for me with 6.0.2 and with 6.3.1 too. It does not call success or error callback. Can somebody help me to sort this out?