Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14560] iOS: Typo in setActivityType (GeolocationModule.m)

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2013-12-13T19:35:39.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 20, 2013 Sprint 20 API, Release 3.2.0
ComponentsiOS
Labelsios, qe-closed-3.2.0
ReporterBen Bahrenburg
AssigneeSabil Rahim
Created2013-07-15T03:54:34.000+0000
Updated2013-12-17T00:08:16.000+0000

Description

There is a typo in setActivityType where accuracy is being set instead of activityType

Comments

  1. Ben Bahrenburg 2013-07-15

    PR provided https://github.com/appcelerator/titanium_mobile/pull/4454
  2. Wilson Luu 2013-10-22

    [~ben.bahrenburg@gmail.com], [~ingo] Are there reproducible steps for this ticket?
  3. Ben Bahrenburg 2013-10-22

    Apologizes this was fixed as part of this PR https://github.com/appcelerator/titanium_mobile/pull/4454.
  4. Samuel Dowse 2013-12-13

    Verified fixed on: Mac OSX 10.9 Mavericks Titanium SDK, build: 3.2.0.v20131212122847 CLI: 3.2.0-cr3 GeolocationModule.m now has
    setActivityType:activityType
    instead of
    setActivityType:accuracy
    Closing.
  5. Samuel Dowse 2013-12-13

    Re-opening, waiting for [~srahim] test code
  6. Wilson Luu 2013-12-17

    Closing ticket as fixed. Verified Ti.Geolocation.setActivityType is correctly setting the activityTypes. Below is the test code. Verify the last alert dialog displays something like this: "current ActivityType is :: " + Ti.Geolocation.activityType + " should be :: "+ Ti.Geolocation.ACTIVITYTYPE_FITNESS"
       Ti.Geolocation.purpose = "GPS demo";
       var authorization = Titanium.Geolocation.locationServicesAuthorization;
       Ti.API.info('Authorization: '+authorization);
       if (authorization == Titanium.Geolocation.AUTHORIZATION_DENIED) {
       	Ti.UI.createAlertDialog({
       		title:'Kitchen Sink',
       		message:'You have disallowed Titanium from running geolocation services.'
       	}).show();
       }
       else if (authorization == Titanium.Geolocation.AUTHORIZATION_RESTRICTED) {
       	Ti.UI.createAlertDialog({
       		title:'Kitchen Sink',
       		message:'Your system has disallowed Titanium from running geolocation services.'
       	}).show();
       }
       
       Titanium.Geolocation.headingFilter = 90;
       Ti.Geolocation.getCurrentHeading(function(e)
       {
       	if (e.error)
       	{
       		currentHeading.text = 'error: ' + e.error;
       		Ti.API.info("Code translation: "+translateErrorCode(e.code));
       		return;
       	}
       	var x = e.heading.x;
       	var y = e.heading.y;
       	var z = e.heading.z;
       	var magneticHeading = e.heading.magneticHeading;
       	var accuracy = e.heading.accuracy;
       	var trueHeading = e.heading.trueHeading;
       	var timestamp = e.heading.timestamp;
       
       	
       	Titanium.API.info('geo - current heading: ' + new Date(timestamp) + ' x ' + x + ' y ' + y + ' z ' + z);
       });
       alert("current ActivityType :: " + Ti.Geolocation.activityType);
       Ti.API.info("changing activityType to Ti.Geolocation.ACTIVITYTYPE_FITNESS");
       Ti.Geolocation.setActivityType(Ti.Geolocation.ACTIVITYTYPE_FITNESS);
       alert("current ActivityType is :: " + Ti.Geolocation.activityType + " should be :: "+ Ti.Geolocation.ACTIVITYTYPE_FITNESS);
       
    Tested on: Appcelerator Studio, build: 3.2.0.201312151544 SDK build: 3.2.0.v20131216064236 CLI: 3.2.0-cr3 Alloy: 1.3.0-cr Xcode: 5.0.2 Device: iphone 4s (7.0.2), iphone 5 (6.1.3)

JSON Source