Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23492

Windows: Parity issue with Ti.Geolocation.reverseGeocoder callback response

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
    • Story Points:
      5
    • Sprint:
      2016 Sprint 13 SDK

      Description

      Ti.Geolocation.reverseGeocoder callback function should get a ReverseGeocoderResponse style object back: http://docs.appcelerator.com/platform/latest/#!/api/ReverseGeocodeResponse

      On Windows, it appears we effectively return the equivalent of response.places[0] as the object.

      Test case:

      	// FIXME Windows doesn't honor the API properly! We have zipcode on the data object itself!
      	it('reverseGeocoder', function (finish) {
      		should(Ti.Geolocation.reverseGeocoder).be.a.Function;
      		Ti.Geolocation.reverseGeocoder(37.3883645, -122.0512682, function (data) {
      			try {
      				should(data).have.property('success').which.is.a.Boolean;
      				should(data).have.property('code').which.is.a.Number;
      				// FIXME error property is missing altogether on success for iOS...
      				//should(data).have.property('error'); // undefined on success, holds error message as String otherwise.
      				should(data).have.property('places').which.is.an.Array;
      				should(data.places[0].zipcode).be.eql('94043');
      				should(data.places[0].country).be.eql('United States of America');
      				should(data.places[0].state).be.eql('California');
      				should(data.places[0].country_code).be.eql('US');
      				should(data.places[0]).have.property('city').which.is.a.String;
      				should(data.places[0]).have.property('address').which.is.a.String;
      				should(data.places[0]).have.property('latitude').which.is.a.Number; // docs say String!
      				should(data.places[0]).have.property('longitude').which.is.a.Number; // docs say String!
      				finish();
      			} catch (err) {
      				finish(err);
      			}
      		});
      	});
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                cwilliams Christopher Williams
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-9811
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code