[TIMOB-20269] Ti.Geolocation.reverseGeocoder returns different information on Android and iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2016-01-25T18:53:45.000+0000 |
Affected Version/s | Release 5.1.2 |
Fix Version/s | Release 5.4.0 |
Components | Android, iOS |
Labels | n/a |
Reporter | Chris Bowley |
Assignee | Chee Kiat Ng |
Created | 2016-01-25T15:08:47.000+0000 |
Updated | 2016-06-23T22:59:44.000+0000 |
Description
On iOS the reverse geocoder response is passed straight through, but on Android the place objects are built (https://github.com/appcelerator/titanium_mobile/blob/bc85170157d3bebc5de1d61a9fe6e34bce84a8c9/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/TiLocation.java#L330).
This means the API response is inconsistent between platforms with missing fields (e.g. "state"):
iOS:
{
"success": true,
"places": [
{
"street": "West County Road 200 North",
"city": "",
"country": "United States of America",
"address": "755 West County Road 200 North, Nash, IN 46122, United States of America",
"zipcode": "46122",
"longitude": -86.53846722826599,
"latitude": 39.790183228524015,
"country_code": "US",
"state": "Indiana"
}
],
"code": 0
}
Android:
{
"source": {
"locationServicesEnabled": true,
"__propertiesDefined__": true,
"lastGeolocation": null,
"bubbleParent": true,
"apiName": "Ti.Geolocation",
"hasCompass": false
},
"code": 0,
"places": [
{
"address": "755 West County Road 200 North, Nash, IN 46122, United States of America",
"street": "West County Road 200 North",
"postalCode": "46122",
"country_code": "US",
"countryCode": "US",
"country": "United States of America",
"street1": "West County Road 200 North",
"longitude": "-86.538467228266",
"region2": "",
"city": "",
"latitude": "39.790183228524",
"region1": "",
"displayAddress": "755 West County Road 200 North, Nash, IN 46122, United States of America"
}
],
"success": true
}
Closing as duplicate & as the original issue is closed.