Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20269] Ti.Geolocation.reverseGeocoder returns different information on Android and iOS

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2016-01-25T18:53:45.000+0000
Affected Version/sRelease 5.1.2
Fix Version/sRelease 5.4.0
ComponentsAndroid, iOS
Labelsn/a
ReporterChris Bowley
AssigneeChee Kiat Ng
Created2016-01-25T15:08:47.000+0000
Updated2016-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  
}

Comments

  1. Lokesh Choudhary 2016-06-23

    Closing as duplicate & as the original issue is closed.

JSON Source