{"id":19162329,"url":"https://github.com/agilie/aglocationdispatcher","last_synced_at":"2025-08-21T04:30:59.325Z","repository":{"id":27237649,"uuid":"30709280","full_name":"agilie/AGLocationDispatcher","owner":"agilie","description":"Location manage framework working in different modes","archived":false,"fork":false,"pushed_at":"2017-06-19T12:24:50.000Z","size":960,"stargazers_count":148,"open_issues_count":2,"forks_count":21,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-08-13T23:30:45.620Z","etag":null,"topics":["background-jobs","ios","location","tracking"],"latest_commit_sha":null,"homepage":"https://agilie.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agilie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-12T15:40:14.000Z","updated_at":"2024-10-17T02:34:37.000Z","dependencies_parsed_at":"2022-08-21T02:20:43.360Z","dependency_job_id":null,"html_url":"https://github.com/agilie/AGLocationDispatcher","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/agilie/AGLocationDispatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2FAGLocationDispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2FAGLocationDispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2FAGLocationDispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2FAGLocationDispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilie","download_url":"https://codeload.github.com/agilie/AGLocationDispatcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilie%2FAGLocationDispatcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271425005,"owners_count":24757383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-jobs","ios","location","tracking"],"created_at":"2024-11-09T09:10:20.423Z","updated_at":"2025-08-21T04:30:59.022Z","avatar_url":"https://github.com/agilie.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AGLocationDispatcher\n\nDispatcher provides easy-to-use access to iOS device location/background location/tracking/etc. It wraps CoreLocation with convenient well customized interface. Dispatcher's classes for tracking current user location, direct and reverse geocoding , tracking enter/exit region, logging user route and speed.\n\n[![CI Status](http://img.shields.io/travis/agilie/AGLocationDispatcher.svg?style=flat)](https://travis-ci.org/agilie/AGLocationDispatcher)\n[![Version](https://img.shields.io/cocoapods/v/AGLocationDispatcher.svg?style=flat)](http://cocoadocs.org/docsets/AGLocationDispatcher)\n[![License](https://img.shields.io/cocoapods/l/AGLocationDispatcher.svg?style=flat)](http://cocoadocs.org/docsets/AGLocationDispatcher)\n[![Platform](https://img.shields.io/cocoapods/p/AGLocationDispatcher.svg?style=flat)](http://cocoadocs.org/docsets/AGLocationDispatcher)\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Add required .plist entries\n\nBy reason of iOS 8 you are required to define a message that will be presented to the user on location authorization request. You should define this message into your app's *-Info.plist file. \nAdd at least one of the following keys, depending on which location update mode you request:\n\nNSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription\n\nMake sure you added this key in the right .plist file (common mistake is entering it into test-Info.plist) and appropriate message text as a value.\n\n## Tracking user location\n\nTo start tracking location, initialize AGLocationDispatcher or AGRouteDispatcher with default init for standart setup  \n(default updating interval - 1 min, horizontal accuracy - 100 meters)\n\nalso you can customize service with following initializer -\n\ninitWithUpdatingInterval: andDesiredAccuracy:\n\n## Demo apps:\n\n### AGGeoBackgroundDemo.xcodeproj\n\n![Demo](https://agilie.com/distribute/location_dispatch/screen1.png)\n![Demo](https://agilie.com/distribute/location_dispatch/screen2.png)\n\nA simple app which displays current device location (and carries out some actions with these data) in a background app state. The app identifies the location and displays this information in case it is changed significantly (about ~1000 ft) or when the app processes fetch action from iOS (10~15 minutes interval).\nIn a background mode app can identify location within a time limit (as well as send location to a server or save in coredata).\nOur AGBackgroundLocationDispatcher class integrates the location method with one simple API. (See AppDelegate.m).\n\n\nAdditional information:\n1 Significant location \n2 Background fetch\n\n### AGGeoCodeDemo.xcodeproj\n\n![Demo](https://agilie.com/distribute/location_dispatch/screen3.png)\n\nDemonstrate our simple wrapper that proposes method for multiple provider geocoder service. App shows geocode (location into address) and reverse geocode (address into location), with selection a provider from our list (Yandex, Google, Apple).\n\n### AGGeoRegionTrackingDemo.xcodeproj\n\n[![Demo](https://agilie.com/distribute/location_dispatch/region_demo.gif)](https://youtu.be/9ru01N9g6AI)\n\nThis demo app indicates when a user enters/exits the picked region with diameter un 100m.\nUser can pick a region by dragging green circle, start tracking this region (start button in bottom), track his position on the map and receive notifications when entering or exiting the region. Just stop tracking current region and pick another one. Have fun!\nP.S. If you want to simulate location tracking: tap “Simulate location” icon in Xcode bottom bar and pick “New York City Marathon” when you start your app\nor\ngo to you scheme \u003e Edit scheme \u003e Pick “New York City Marathon” in Default location list.\n\n### AGGeoTrackingDemo.xcodeproj\n\n[![Demo](https://agilie.com/distribute/location_dispatch/tracking_demo.gif)](https://youtu.be/w2TmZ4t7NGg)\n\nThis demo app can track your current position, record your route, show your current average speed and distance. Also you can save your routes and view them later. Besides that you can pick one of 3 position markers styles.\nJust tap Start rec button and go on. You will see your current route drawn with green line. Press Stop \u0026 Save and go to saved routes screen by tapping Saved routes button. Here you can see your last saved route. You can pick any of your routes by tapping Saved routes button in bottom. Have fun!\n\nP.S. If you want to simulate location tracking: tap “Simulate location” icon in Xcode bottom bar and pick “New York City Marathon” when you start your app\nor\ngo to you scheme \u003e Edit scheme \u003e Pick “New York City Marathon” in Default location list.\n\n\n\nExample:\n\n```obj-c\nAGRouteDispatcher *routeDisptcher = [AGRouteDispatcher initWithUpdatingInterval:kDefaultLocationTimeIntervalUpdateOneMinute andDesiredAccuracy:kAGHorizontalAccuracyThresholdBlock]\n```\n\nAt viewcontroller's module, you can use this methods with blocks:\n\n```obj-c\n- (void)startUpdatingLocationWithBlock: errorBlock:\n- (void)startUpdatingLocationAndSpeedWithBlock: errorBlock:\n- (void)requestUserLocationWhenInUseWithBlock:\n- (void)requestUserLocationAlwaysWithBlock:\n- (void)currentLocationWithBlock: errorBlock:\n```\n\ninits and getters:\n\n```obj-c\n+ (BOOL)locationServicesEnabled;\n+ (BOOL)significantLocationChangeMonitoringAvailable;\n\n- (instancetype)init;\n- (instancetype)initWithUpdatingInterval:(NSTimeInterval)interval andDesiredAccuracy:(CLLocationAccuracy)horizontalAccuracy;\n- (CLLocationManager *)locationManager;\n- (CLLocationAccuracy)horizontalAccuracyThreshold;\n```\n\n## Background Tracking user location\n\nAGLocationDispatcher allows several methods of background location, depends of application info plist configuratons and locationUpdateBackgroundMode setting (default is AGLocationBackgroundModeSignificantLocationChanges mode)\nWhen application is suspended or terminated you need use spectial background location wrapper: AGBackgroundLocationDispatcher  (see example AppDelegate methods)\n\nBackground location modes:\n\n- No background location mode: When app go to backgroud location updated will stop. After app did become active location updating will be activated again.\nSet locationUpdateBackgroundMode property (AGLocationDispatcher object) to AGLocationBackgroundModeForegroundOnly state;\n\n- Always actiwe: required UIBackgroundModes \"location\" key, application never suspend, location accuracy and battery rate will be maximum, no need additional code.\nSet locationUpdateBackgroundMode property (AGLocationDispatcher object) to any state except AGLocationBackgroundModeForegroundOnly;\n\n- Significant location mode: Work when app is terminated/suspended, provide GPS-level accuracy (over 500 metters positon change) and very low-energy location updating. Required UIBackgroundModes \"location\" key and implementin special handler(based on AGBackgroundLocationDispatcher wrapper) in app delegate code (see example appDelegate method didFinishLaunchingWithOptions). \nSet locationUpdateBackgroundMode property (AGLocationDispatcher object) to AGLocationBackgroundModeSignificantLocationChanges state;\n\n- Fetch based location mode: Work when app is suspended, provide normall accuracy and very middle-energy location updating, but activated when device is unblock/activate. Required UIBackgroundModes \"fetch\" key and implementin special handler(based on AGBackgroundLocationDispatcher wrapper) in app delegate code (see example appDelegate method performFetchWithCompletionHandler). \nSet locationUpdateBackgroundMode property (AGLocationDispatcher object) to AGLocationBackgroundModeFetch state;\n\nAGBackgroundLocationDispatcher code runs when app is NOT active, you default apps object amd UI will NOT exist. AGBackgroundLocationDispatcher code must store location locally (in file, coredata etc), send it to server side or create UILocalNotification (for start the app in normal mode).  AGBackgroundLocationDispatcher code will be terminated by system after 10s~30s after active running.\n\nAGBackgroundLocationDispatcher wrapper provide init method with block for you background code and callback block, you need call that block when you location task will complete. \n\nExample AGBackgroundLocationDispatcher code:\n\n```obj-c\n[[AGBackgroundLocationDispatcher alloc] initWithASynchronousLocationUpdateBlock:^(AGLocation *newLocation, LDSignificationLocationASynchronousEndUpdateBlock updateCompletionBlock) {\n\n    NSString *string = [NSString stringWithFormat:@\"example.com?location=%@\",  [newLocation description] ];\n    NSURL *url = [NSURL URLWithString:string];\n    NSURLRequest *request = [NSURLRequest requestWithURL:url];\n\n    AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest: request];\n    \n    [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {\n\n        updateCompletionBlock(); //data send successfully\n\n    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {\n\n        updateCompletionBlock(); //data dont send \n\n    }];\n\n    [operation start];\n\n}];\n```\n\n## Use geocoding\n\nUse AGGeoDispatcher class for direct and reverse geocoding.\n\nJust initialize AGGeoDispatcher class\n\n```obj-c\nAGGeoDispatcher *geoDispatcher = [[AGGeoDispatcher alloc] init]\n```\n\nimplement following methods:\n\n```obj-c\n- (void)requestGeocodeForLocation: success: andFail:\n- (void)requestLocationForAddress: success: andFail:\n```\n\nTo choose geocode provider (Apple, Google, Yandex) use following method:\n\n```obj-c\n- (void)setGeocoderProvider:\n```\n\n## Manage your route\n\nAGRouteDispatcher class provide save/load AGRoute data in local storage with methods:\n\n```obj-c\n- (AGRoute *)loadRouteWithName:\n- (void)saveRoute: name:\n- (void)deleteDocWithName:\n```\n\n## Regions Dispatcher\n\nAGRegionDispatcher class used for monitoring enter/exit some region. Use this block methods for monitoring:\n\n```obj-c\n- (void)addCoordinateForMonitoring: updateBlock: failBlock:\n- (void)addCoordinateForMonitoring: withRadius: desiredAccuracy: updateBlock: failBlock:\n- (void)addRegionForMonitoring: desiredAccuracy: updateBlock: failBlock:\n- (void)stopMonitoringForRegion:\n- (void)stopMonitoringAllRegions\n```\n\n## Requirements\n\n## Installation\n\nAGLocationDispatcher is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n    pod \"AGLocationDispatcher\"\n\n## Author\n\nAgilie \u003cinfo@agilie.com\u003e\n\n\n## Contact us\n\n\u003cios@agilie.com\u003e\n\n\n## License\n\nAGLocationDispatcher is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilie%2Faglocationdispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilie%2Faglocationdispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilie%2Faglocationdispatcher/lists"}