{ "id": "97654", "key": "TIMOB-10041", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14065", "description": "Sprint 2012-17 API", "name": "Sprint 2012-17 API", "archived": true, "released": true, "releaseDate": "2012-08-27" }, { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-16T12:15:07.000+0000", "created": "2012-07-19T12:30:17.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "SupportTeam", "api", "qe-port" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [ { "id": "21641", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "101444", "key": "TIMOB-10965", "fields": { "summary": "iOS: Feature: Add property to determine if the app is being launched by the OS or by the user", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-11-19T09:34:10.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2.Feature\r\nExposing startMonitoringSignificantLocationChanges method allows significant power savings along with other benefits when using Background Location Services.\r\n\r\nh3.iOS release notes\r\n\r\nh6.Starting the Significant-Change Location Service\r\nIn iOS 4.0 and later, you can use the significant-change location service to receive location events. This service offers a significant power savings and provides accuracy that is good enough for most applications. It uses the device's cellular radio to determine the user's location and report changes in that location, allowing the system to manage power usage much more aggressively than it could otherwise. This service is also capable of waking up an application that is currently suspended or not running in order to deliver new location data.\r\n\r\nTo use the significant-change location service, create an instance of the CLLocationManager class, assign a delegate to it, and call the startMonitoringSignificantLocationChanges method as shown in Listing 1-2. As location data becomes available, the location manager notifies its assigned delegate object. If a location update has already been delivered, you can also get the most recent location data directly from the CLLocationManager object without waiting for a new event to be delivered.\r\n\r\nh6.Listing 1-2 Starting the significant-change location service\r\n{code}\r\n- (void)startSignificantChangeUpdates\r\n{\r\n // Create the location manager if this object does not\r\n // already have one.\r\n if (nil == locationManager)\r\n locationManager = [[CLLocationManager alloc] init];\r\n \r\n locationManager.delegate = self;\r\n [locationManager startMonitoringSignificantLocationChanges];\r\n}\r\n{code}\r\n\r\nh6.iOS source information\r\nhttp://developer.apple.com/library/ios/#DOCUMENTATION/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html#//apple_ref/doc/uid/TP40009497-CH2-SW1\r\n\r\n\r\nh4.Testing Code\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n\tbackgroundColor:'white'\r\n});\r\n\r\nTi.Geolocation.preferredProvider = \"gps\";\r\n\r\nTi.Geolocation.purpose = \"GPS demo\";\r\n\r\nfunction translateErrorCode(code) {\r\n\tif (code == null) {\r\n\t\treturn null;\r\n\t}\r\n\tswitch (code) {\r\n\t\tcase Ti.Geolocation.ERROR_LOCATION_UNKNOWN:\r\n\t\t\treturn \"Location unknown\";\r\n\t\tcase Ti.Geolocation.ERROR_DENIED:\r\n\t\t\treturn \"Access denied\";\r\n\t\tcase Ti.Geolocation.ERROR_NETWORK:\r\n\t\t\treturn \"Network error\";\r\n\t\tcase Ti.Geolocation.ERROR_HEADING_FAILURE:\r\n\t\t\treturn \"Failure to detect heading\";\r\n\t\tcase Ti.Geolocation.ERROR_REGION_MONITORING_DENIED:\r\n\t\t\treturn \"Region monitoring access denied\";\r\n\t\tcase Ti.Geolocation.ERROR_REGION_MONITORING_FAILURE:\r\n\t\t\treturn \"Region monitoring access failure\";\r\n\t\tcase Ti.Geolocation.ERROR_REGION_MONITORING_DELAYED:\r\n\t\t\treturn \"Region monitoring setup delayed\";\r\n\t}\r\n}\r\n\r\nvar currentHeadingLabel = Titanium.UI.createLabel({\r\n\ttext:'Current Heading (One Shot)',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#111',\r\n\ttop:10,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(currentHeadingLabel);\r\n\r\nvar currentHeading = Titanium.UI.createLabel({\r\n\ttext:'Updated Heading not fired',\r\n\tfont:{fontSize:12},\r\n\tcolor:'#444',\r\n\ttop:30,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(currentHeading);\r\n\r\nvar updatedHeadingLabel = Titanium.UI.createLabel({\r\n\ttext:'Updated Heading',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#111',\r\n\ttop:50,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedHeadingLabel);\r\n\r\nvar updatedHeading = Titanium.UI.createLabel({\r\n\ttext:'Updated Heading not fired',\r\n\tfont:{fontSize:12},\r\n\tcolor:'#444',\r\n\ttop:70,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedHeading);\r\n\r\nvar updatedHeadingTime = Titanium.UI.createLabel({\r\n\ttext:'',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:90,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedHeadingTime);\r\n\r\nvar currentLocationLabel = Titanium.UI.createLabel({\r\n\ttext:'Current Location (One Shot)',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#111',\r\n\ttop:110,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(currentLocationLabel);\r\n\r\nvar currentLocation = Titanium.UI.createLabel({\r\n\ttext:'Current Location not fired',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:130,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(currentLocation);\r\n\r\nvar updatedLocationLabel = Titanium.UI.createLabel({\r\n\ttext:'Updated Location',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#111',\r\n\ttop:150,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedLocationLabel);\r\n\r\nvar updatedLocation = Titanium.UI.createLabel({\r\n\ttext:'Updated Location not fired',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:170,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedLocation);\r\n\r\nvar updatedLatitude = Titanium.UI.createLabel({\r\n\ttext:'',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:190,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedLatitude);\r\n\r\nvar updatedLocationAccuracy = Titanium.UI.createLabel({\r\n\ttext:'',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:210,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedLocationAccuracy);\r\n\r\nvar updatedLocationTime = Titanium.UI.createLabel({\r\n\ttext:'',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:230,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(updatedLocationTime);\r\n\r\n\r\n\r\nvar forwardGeoLabel = Titanium.UI.createLabel({\r\n\ttext:'Forward Geo (Addr->Coords)',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#111',\r\n\ttop:250,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(forwardGeoLabel);\r\n\r\nvar forwardGeo = Titanium.UI.createLabel({\r\n\ttext:'',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:270,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(forwardGeo);\r\n\r\nvar reverseGeoLabel = Titanium.UI.createLabel({\r\n\ttext:'Reverse Geo (Coords->Addr)',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#111',\r\n\ttop:290,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(reverseGeoLabel);\r\n\r\nvar reverseGeo = Titanium.UI.createLabel({\r\n\ttext:'',\r\n\tfont:{fontSize:11},\r\n\tcolor:'#444',\r\n\ttop:310,\r\n\tleft:10,\r\n\theight:15,\r\n\twidth:300\r\n});\r\nwin.add(reverseGeo);\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle:'Track Significant Location Change(TSLC)',\r\n\twidth:Ti.UI.SIZE,\r\n\theight:Ti.UI.SIZE,\r\n\tbackgroundColor: '',\r\n\tbottom:70\r\n});\r\nbutton.addEventListener('click',function(){\r\n\tvar val = Ti.Geolocation.trackSignificantLocationChange;\r\n\tTi.Geolocation.trackSignificantLocationChange = !val;\r\n});\r\nwin.add(button);\r\n//Check track significant value\r\nvar button2 = Ti.UI.createButton({\r\n\ttitle:'Check value of TSLC',\r\n\twidth:Ti.UI.SIZE,\r\n\theight:Ti.UI.SIZE,\r\n\tbackgroundColor: 'grey',\r\n\tbottom:5\r\n});\r\nbutton2.addEventListener('click',function(){\r\n\tvar value = Ti.Geolocation.trackSignificantLocationChange;\r\n\tTi.API.info('---> Ti.Geolocation.trackingSignificantLocationChange ?'+ value);\r\n\tTitanium.UI.createAlertDialog({title:'GPS',message:'trackingSignificantLocationChange:'+value}).show();\r\n\r\n});\r\nwin.add(button2);\r\n\r\n// state vars used by resume/pause\r\nvar headingAdded = false;\r\nvar locationAdded = false;\r\n\r\n//\r\n// SHOW CUSTOM ALERT IF DEVICE HAS GEO TURNED OFF\r\n//\r\nif (Titanium.Geolocation.locationServicesEnabled === false)\r\n{\r\n\tTitanium.UI.createAlertDialog({title:'Kitchen Sink', message:'Your device has geo turned off - turn it on.'}).show();\r\n}\r\nelse\r\n{\r\n\tvar authorization = Titanium.Geolocation.locationServicesAuthorization;\r\n\tTi.API.info('Authorization: '+authorization);\r\n\tif (authorization == Titanium.Geolocation.AUTHORIZATION_DENIED) {\r\n\t\tTi.UI.createAlertDialog({\r\n\t\t\ttitle:Titanium.App.getName(),\r\n\t\t\tmessage:'You have disallowed Titanium from running geolocation services.'\r\n\t\t}).show();\r\n\t}\r\n\telse if (authorization == Titanium.Geolocation.AUTHORIZATION_RESTRICTED) {\r\n\t\tTi.UI.createAlertDialog({\r\n\t\t\ttitle:Titanium.App.getName(),\r\n\t\t\tmessage:'Your system has disallowed Titanium from running geolocation services.'\r\n\t\t}).show();\r\n\t}\r\n\r\n\r\n\t//\r\n\t// IF WE HAVE COMPASS GET THE HEADING\r\n\t//\r\n\tif (Titanium.Geolocation.hasCompass)\r\n\t{\r\n\t\t//\r\n\t\t// TURN OFF ANNOYING COMPASS INTERFERENCE MESSAGE\r\n\t\t//\r\n\t\tTitanium.Geolocation.showCalibration = false;\r\n\r\n\t\t//\r\n\t\t// SET THE HEADING FILTER (THIS IS IN DEGREES OF ANGLE CHANGE)\r\n\t\t// EVENT WON'T FIRE UNLESS ANGLE CHANGE EXCEEDS THIS VALUE\r\n\t\tTitanium.Geolocation.headingFilter = 90;\r\n\r\n\t\t//\r\n\t\t// GET CURRENT HEADING - THIS FIRES ONCE\r\n\t\t//\r\n\t\tTi.Geolocation.getCurrentHeading(function(e)\r\n\t\t{\r\n\t\t\tif (e.error)\r\n\t\t\t{\r\n\t\t\t\tcurrentHeading.text = 'error: ' + e.error;\r\n\t\t\t\tTi.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar x = e.heading.x;\r\n\t\t\tvar y = e.heading.y;\r\n\t\t\tvar z = e.heading.z;\r\n\t\t\tvar magneticHeading = e.heading.magneticHeading;\r\n\t\t\tvar accuracy = e.heading.accuracy;\r\n\t\t\tvar trueHeading = e.heading.trueHeading;\r\n\t\t\tvar timestamp = e.heading.timestamp;\r\n\r\n\t\t\tcurrentHeading.text = 'x:' + x + ' y: ' + y + ' z:' + z;\r\n\t\t\tTitanium.API.info('geo - current heading: ' + new Date(timestamp) + ' x ' + x + ' y ' + y + ' z ' + z);\r\n\t\t});\r\n\r\n\t\t//\r\n\t\t// EVENT LISTENER FOR COMPASS EVENTS - THIS WILL FIRE REPEATEDLY (BASED ON HEADING FILTER)\r\n\t\t//\r\n\t\tvar headingCallback = function(e)\r\n\t\t{\r\n\t\t\tif (e.error)\r\n\t\t\t{\r\n\t\t\t\tupdatedHeading.text = 'error: ' + e.error;\r\n\t\t\t\tTi.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar x = e.heading.x;\r\n\t\t\tvar y = e.heading.y;\r\n\t\t\tvar z = e.heading.z;\r\n\t\t\tvar magneticHeading = e.heading.magneticHeading;\r\n\t\t\tvar accuracy = e.heading.accuracy;\r\n\t\t\tvar trueHeading = e.heading.trueHeading;\r\n\t\t\tvar timestamp = e.heading.timestamp;\r\n\r\n\t\t\tupdatedHeading.text = 'x:' + x + ' y: ' + y + ' z:' + z;\r\n\t\t\tupdatedHeadingTime.text = 'timestamp:' + new Date(timestamp);\r\n\t\t\tupdatedHeading.color = 'red';\r\n\t\t\tupdatedHeadingTime.color = 'red';\r\n\t\t\tsetTimeout(function()\r\n\t\t\t{\r\n\t\t\t\tupdatedHeading.color = '#444';\r\n\t\t\t\tupdatedHeadingTime.color = '#444';\r\n\r\n\t\t\t},100);\r\n\r\n\t\t\tTitanium.API.info('geo - heading updated: ' + new Date(timestamp) + ' x ' + x + ' y ' + y + ' z ' + z);\r\n\t\t};\r\n\t\tTitanium.Geolocation.addEventListener('heading', headingCallback);\r\n\t\theadingAdded = true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tTitanium.API.info(\"No Compass on device\");\r\n\t\tcurrentHeading.text = 'No compass available';\r\n\t\tupdatedHeading.text = 'No compass available';\r\n\t}\r\n\r\n\t//\r\n\t// SET ACCURACY - THE FOLLOWING VALUES ARE SUPPORTED\r\n\t//\r\n\t// Titanium.Geolocation.ACCURACY_BEST\r\n\t// Titanium.Geolocation.ACCURACY_NEAREST_TEN_METERS\r\n\t// Titanium.Geolocation.ACCURACY_HUNDRED_METERS\r\n\t// Titanium.Geolocation.ACCURACY_KILOMETER\r\n\t// Titanium.Geolocation.ACCURACY_THREE_KILOMETERS\r\n\t//\r\n\tTitanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n\r\n\t//\r\n\t// SET DISTANCE FILTER. THIS DICTATES HOW OFTEN AN EVENT FIRES BASED ON THE DISTANCE THE DEVICE MOVES\r\n\t// THIS VALUE IS IN METERS\r\n\t//\r\n\tTitanium.Geolocation.distanceFilter = 10;\r\n\r\n\t//\r\n\t// GET CURRENT POSITION - THIS FIRES ONCE\r\n\t//\r\n\tTitanium.Geolocation.getCurrentPosition(function(e)\r\n\t{\r\n\t\tif (!e.success || e.error)\r\n\t\t{\r\n\t\t\tcurrentLocation.text = 'error: ' + JSON.stringify(e.error);\r\n\t\t\tTi.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n\t\t\talert('error ' + JSON.stringify(e.error));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar longitude = e.coords.longitude;\r\n\t\tvar latitude = e.coords.latitude;\r\n\t\tvar altitude = e.coords.altitude;\r\n\t\tvar heading = e.coords.heading;\r\n\t\tvar accuracy = e.coords.accuracy;\r\n\t\tvar speed = e.coords.speed;\r\n\t\tvar timestamp = e.coords.timestamp;\r\n\t\tvar altitudeAccuracy = e.coords.altitudeAccuracy;\r\n\t\tTi.API.info('speed ' + speed);\r\n\t\tcurrentLocation.text = 'long:' + longitude + ' lat: ' + latitude;\r\n\r\n\t\tTitanium.API.info('geo - current location: ' + new Date(timestamp) + ' long ' + longitude + ' lat ' + latitude + ' accuracy ' + accuracy);\r\n\t});\r\n\r\n\t//\r\n\t// EVENT LISTENER FOR GEO EVENTS - THIS WILL FIRE REPEATEDLY (BASED ON DISTANCE FILTER)\r\n\t//\r\n\tvar locationCallback = function(e)\r\n\t{\r\n\t\tif (!e.success || e.error)\r\n\t\t{\r\n\t\t\tupdatedLocation.text = 'error:' + JSON.stringify(e.error);\r\n\t\t\tupdatedLatitude.text = '';\r\n\t\t\tupdatedLocationAccuracy.text = '';\r\n\t\t\tupdatedLocationTime.text = '';\r\n\t\t\tTi.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar longitude = e.coords.longitude;\r\n\t\tvar latitude = e.coords.latitude;\r\n\t\tvar altitude = e.coords.altitude;\r\n\t\tvar heading = e.coords.heading;\r\n\t\tvar accuracy = e.coords.accuracy;\r\n\t\tvar speed = e.coords.speed;\r\n\t\tvar timestamp = e.coords.timestamp;\r\n\t\tvar altitudeAccuracy = e.coords.altitudeAccuracy;\r\n\r\n\t\t//Titanium.Geolocation.distanceFilter = 100; //changed after first location event\r\n\r\n\t\tupdatedLocation.text = 'long:' + longitude;\r\n\t\tupdatedLatitude.text = 'lat: '+ latitude;\r\n\t\tupdatedLocationAccuracy.text = 'accuracy:' + accuracy;\r\n\t\tupdatedLocationTime.text = 'timestamp:' +new Date(timestamp);\r\n\r\n\t\tupdatedLatitude.color = 'red';\r\n\t\tupdatedLocation.color = 'red';\r\n\t\tupdatedLocationAccuracy.color = 'red';\r\n\t\tupdatedLocationTime.color = 'red';\r\n\t\tsetTimeout(function()\r\n\t\t{\r\n\t\t\tupdatedLatitude.color = '#444';\r\n\t\t\tupdatedLocation.color = '#444';\r\n\t\t\tupdatedLocationAccuracy.color = '#444';\r\n\t\t\tupdatedLocationTime.color = '#444';\r\n\r\n\t\t},100);\r\n\r\n\t\t// reverse geo\r\n\t\tTitanium.Geolocation.reverseGeocoder(latitude,longitude,function(evt)\r\n\t\t{\r\n\t\t\tif (evt.success) {\r\n\t\t\t\tvar places = evt.places;\r\n\t\t\t\tif (places && places.length) {\r\n\t\t\t\t\treverseGeo.text = places[0].address;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treverseGeo.text = \"No address found\";\r\n\t\t\t\t}\r\n\t\t\t\tTi.API.debug(\"reverse geolocation result = \"+JSON.stringify(evt));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tTi.UI.createAlertDialog({\r\n\t\t\t\t\ttitle:'Reverse geo error',\r\n\t\t\t\t\tmessage:evt.error\r\n\t\t\t\t}).show();\r\n\t\t\t\tTi.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tTitanium.API.info('geo - location updated: ' + new Date(timestamp) + ' long ' + longitude + ' lat ' + latitude + ' accuracy ' + accuracy);\r\n\t};\r\n\tTitanium.Geolocation.addEventListener('location', locationCallback);\r\n\tlocationAdded = true;\r\n}\r\nvar addr = \"2065 Hamilton Avenue San Jose California 95125\";\r\n\r\nTitanium.Geolocation.forwardGeocoder(addr,function(evt)\r\n{\r\n\tTi.API.info('in forward ');\r\n\tforwardGeo.text = \"lat:\"+evt.latitude+\", long:\"+evt.longitude;\r\n\tTitanium.Geolocation.reverseGeocoder(evt.latitude,evt.longitude,function(evt)\r\n\t{\r\n\t\tif (evt.success) {\r\n\t\t\tvar text = \"\";\r\n\t\t\tfor (var i = 0; i < evt.places.length; i++) {\r\n\t\t\t\ttext += \"\" + i + \") \" + evt.places[i].address + \"\\n\";\r\n\t\t\t}\r\n\t\t\tTi.API.info('Reversed forward: '+text);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tTi.UI.createAlertDialog({\r\n\t\t\t\ttitle:'Forward geo error',\r\n\t\t\t\tmessage:evt.error\r\n\t\t\t}).show();\r\n\t\t\tTi.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n\t\t}\r\n\t});\r\n});\r\n\r\n// as the destroy handler will remove the listener, only set the pause handler to remove if you need battery savings\r\n\r\nwin.addEventListener('close', function(e) {\r\n\tTi.API.info(\"destroy event received\");\r\n\tif (headingAdded) {\r\n\t\tTi.API.info(\"removing heading callback on destroy\");\r\n\t\tTitanium.Geolocation.removeEventListener('heading', headingCallback);\r\n\t\theadingAdded = false;\r\n\t}\r\n\tif (locationAdded) {\r\n\t\tTi.API.info(\"removing location callback on destroy\");\r\n\t\tTitanium.Geolocation.removeEventListener('location', locationCallback);\r\n\t\tlocationAdded = false;\r\n\t}\r\n});\r\nwin.addEventListener('open', function(e) {\r\n\tTi.API.info(\"resume event received\");\r\n\tif (!headingAdded && headingCallback) {\r\n\t\tTi.API.info(\"adding heading callback on resume\");\r\n\t\tTitanium.Geolocation.addEventListener('heading', headingCallback);\r\n\t\theadingAdded = true;\r\n\t}\r\n\tif (!locationAdded && locationCallback) {\r\n\t\tTi.API.info(\"adding location callback on resume\");\r\n\t\tTitanium.Geolocation.addEventListener('location', locationCallback);\r\n\t\tlocationAdded = true;\r\n\t}\r\n\t});\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Feature: Expose startMonitoringSignificantLocationChanges method", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "210025", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We do not expose new features in service packs so do not add merge tags to these tickets.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-26T20:16:49.000+0000", "updated": "2012-07-26T20:16:49.000+0000" }, { "id": "210178", "author": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Really need this! \r\nI had an app using the location background flag (for over a year) that was now rejected and I was told by Apple to use the monitoring mentioned above.\r\n\r\nI'm basically stuck! I can:\r\na) Remove features that thousands of users have paid for already. \r\nb) Stop upgrading my app. \r\nc) Completely change my applications architecture (e.g. not use Appcelerator - NOT going to happen)\r\nd) Try to build some type of module to allow support for the Change Location service.\r\n\r\nhttp://developer.appcelerator.com/question/140263/significant-change-location-service", "updateAuthor": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-27T08:21:40.000+0000", "updated": "2012-07-27T08:21:40.000+0000" }, { "id": "214812", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/2765 pending against master\r\n", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T11:37:04.000+0000", "updated": "2012-08-16T11:37:04.000+0000" }, { "id": "214829", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/2765 against master", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T12:15:07.000+0000", "updated": "2012-08-16T12:15:07.000+0000" }, { "id": "214831", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixed on 2_1_X by https://github.com/appcelerator/titanium_mobile/pull/2766", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T12:29:10.000+0000", "updated": "2012-08-16T12:29:10.000+0000" }, { "id": "215398", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Additional PR merged https://github.com/appcelerator/titanium_mobile/pull/2786", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T13:31:15.000+0000", "updated": "2012-08-21T13:31:15.000+0000" }, { "id": "215426", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Additional PR 2_1_X merged https://github.com/appcelerator/titanium_mobile/pull/2787", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-21T14:17:22.000+0000", "updated": "2012-08-21T14:17:22.000+0000" }, { "id": "227838", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified with:\r\nSDK: 3.0.0.v20121113170203\r\nStudio: 3.0.0.201211131839\r\nDevice: iPhone4s(v 5.1)", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-19T09:34:10.000+0000", "updated": "2012-11-19T09:34:10.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }