{"id":38956856,"url":"https://github.com/transistorsoft/native-background-geolocation","last_synced_at":"2026-04-06T19:01:05.304Z","repository":{"id":138907954,"uuid":"96893957","full_name":"transistorsoft/native-background-geolocation","owner":"transistorsoft","description":"Advanced Background Geolocation \u0026 Geofencing SDK for iOS \u0026 Android","archived":false,"fork":false,"pushed_at":"2026-04-02T16:13:28.000Z","size":146142,"stargazers_count":51,"open_issues_count":3,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-04-03T09:14:27.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transistorsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-11T13:06:28.000Z","updated_at":"2026-04-02T16:13:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee70742e-2cf9-449b-bfaa-3efd05268959","html_url":"https://github.com/transistorsoft/native-background-geolocation","commit_stats":null,"previous_names":["transistorsoft/native-background-geolocation","transistorsoft/background-geolocation-lt"],"tags_count":77,"template":false,"template_full_name":null,"purl":"pkg:github/transistorsoft/native-background-geolocation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fnative-background-geolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fnative-background-geolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fnative-background-geolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fnative-background-geolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transistorsoft","download_url":"https://codeload.github.com/transistorsoft/native-background-geolocation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fnative-background-geolocation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31485516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-17T16:17:53.540Z","updated_at":"2026-04-06T19:01:05.287Z","avatar_url":"https://github.com/transistorsoft.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nBackground Geolocation Module for iOS \u0026amp; Android\n==============================================================================\n\n[![](https://dl.dropboxusercontent.com/s/nm4s5ltlug63vv8/logo-150-print.png?dl=1)](https://www.transistorsoft.com)\n\n-------------------------------------------------------------------------------\n\nThe *most* sophisticated background **location-tracking \u0026 geofencing** module with battery-conscious motion-detection intelligence for **iOS** and **Android**.\n\nThe plugin's [Philosophy of Operation](../../wiki/Philosophy-of-Operation) is to use **motion-detection** APIs (using accelerometer, gyroscope and magnetometer) to detect when the device is *moving* and *stationary*.\n\n- When the device is detected to be **moving**, the plugin will *automatically* start recording a location according to the configured `distanceFilter` (meters).\n\n- When the device is detected be **stationary**, the plugin will automatically turn off location-services to conserve energy.\n\nAlso available for [React Native](https://github.com/transistorsoft/react-native-background-geolocation), [Cordova](https://github.com/transistorsoft/cordova-background-geolocation-lt) and [NativeScript](https://github.com/transistorsoft/nativescript-background-geolocation-lt)\n\n----------------------------------------------------------------------------\n\nThe **[Android module](http://www.transistorsoft.com/shop/products/native-background-geolocation)** requires [purchasing a license](http://www.transistorsoft.com/shop/products/native-background-geolocation).  However, it *will* work for **DEBUG** builds.  It will **not** work with **RELEASE** builds [without purchasing a license](http://www.transistorsoft.com/shop/products/native-background-geolocation).\n\n(2018) This plugin is supported **full-time** and field-tested **daily** since 2013.\n\n----------------------------------------------------------------------------\n\n[![Google Play](https://dl.dropboxusercontent.com/s/80rf906x0fheb26/google-play-icon.png?dl=1)](https://play.google.com/store/apps/details?id=com.transistorsoft.backgroundgeolocation.react)\n\n![Home](https://dl.dropboxusercontent.com/s/wa43w1n3xhkjn0i/home-framed-350.png?dl=1)\n![Settings](https://dl.dropboxusercontent.com/s/8oad228siog49kt/settings-framed-350.png?dl=1)\n\n\n# Contents\n- ### :books: [API Documentation](./docs/README.md)\n  - [iOS](./docs/README-iOS.md)\n  - [Android](./docs/README-Android.md)\n- ### [Installing the Plugin](#large_blue_diamond-installing-the-plugin)\n- ### [Setup Guides](#large_blue_diamond-setup-guides)\n- ### [Configure your License](#large_blue_diamond-configure-your-license)\n- ### [Android SDK Setup](#large_blue_diamond-android-sdk)\n- ### [Example](#large_blue_diamond-example)\n- ### [Debugging](../../wiki/Debugging)\n- ### [Demo Application](#large_blue_diamond-demo-application)\n- ### [Testing Server](#large_blue_diamond-simple-testing-server)\n\n\n## :large_blue_diamond: Installing the Plugin\n\nYou will have to install the plugin by manually downloading [a Release](https://github.com/transistorsoft/background-geolocation-lt/releases) from this repository.  The plugin is not currently submitted to a package manager (eg: jCenter)\n\nCreate a folder in the root of your application project, eg: `/Libraries` and place the extracted **`background-geolocation`** folder into it:\n\neg: :open_file_folder: **`Libraries/background-geolocation-lt`**\n\n## :large_blue_diamond: Setup Guides\n- ### iOS\n    - [Cocoapods Setup (*recommended*)](docs/INSTALL-IOS-COCOAPOD.md)\n    - [Manual Setup](docs/INSTALL-IOS.md)\n- ### Android\n    - [Manual Setup](docs/INSTALL-ANDROID.md)\n\n## :large_blue_diamond: Example\n\n### iOS\n\n```obj-c\n#import \"ViewController.h\"\n@import TSLocationManager;\n\n@interface ViewController ()\n\n@end\n\n@implementation ViewController\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n\n    // Get a reference to the SDK\n    TSLocationManager *bgGeo = [TSLocationManager sharedInstance];\n    TSConfig *config = [TSConfig sharedInstance];\n\n    // Provide a reference to your viewController.\n    bgGeo.viewController = self;\n\n    [config updateWithBlock:^(TSConfigBuilder *builder) {\n        builder.debug = YES;\n        builder.logLevel = tsLogLevelVerbose;\n        builder.desiredAccuracy = kCLLocationAccuracyBest;\n        builder.distanceFilter = 10;\n        builder.stopOnTerminate = NO;\n        builder.startOnBoot = YES;\n        builder.url = @\"http://your.server.com/locations\";\n    }];\n\n    // Listen to events.\n    [bgGeo onLocation:^(TSLocation *location) {\n        NSLog(@\"[location] %@\", [location toDictionary]);\n    } failure:^(NSError *error) {\n        NSLog(@\"[location] error %@\", @(error.code));\n    }];\n\n    // Signal #ready to the plugin.\n    [bgGeo ready];\n\n    if (!config.enabled) {\n        // Start tracking immediately (if not already).\n        [bgGeo start];\n    }\n}\n\n```\n\n### Android\n\n```java\npackage com.your.app;\n\nimport com.transistorsoft.locationmanager.adapter.BackgroundGeolocation;\n\npublic class MainActivity extends AppCompatActivity {\n    private static String TAG = \"MyApp\";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Get a reference to the SDK\n        final BackgroundGeolocation bgGeo = BackgroundGeolocation.getInstance(getApplicationContext(), getIntent());\n        final TSConfig config = TSConfig.getInstance(getApplicationContext());\n\n        // Configure the SDK\n        config.updateWithBuilder()\n                .setDebug(true) // Sound Fx / notifications during development\n                .setLogLevel(5) // Verbose logging during development\n                .setDesiredAccuracy(LocationRequest.PRIORITY_HIGH_ACCURACY)\n                .setDistanceFilter(10F)\n                .setStopTimeout(1L)\n                .setHeartbeatInterval(60)\n                .setStopOnTerminate(false)\n                .setForegroundService(true)\n                .setStartOnBoot(true)\n                .setUrl(\"http://your.server.com/locations\")\n                .commit();\n\n        // Listen events\n        bgGeo.onLocation(new TSLocationCallback() {\n            @Override\n            public void onLocation(TSLocation location) {\n                Log.i(TAG, \"[location] \" + location.toJson());\n            }\n            @Override\n            public void onError(Integer code) {\n                Log.i(TAG, \"[location] ERROR: \" + code);\n            }\n        });\n\n        bgGeo.onMotionChange(new TSLocationCallback() {\n            @Override\n            public void onLocation(TSLocation tsLocation) {\n                Log.i(TAG, \"[motionchange] \" + tsLocation.toJson());\n            }\n            @Override\n            public void onError(Integer error) {\n                Log.i(TAG, \"[motionchange] ERROR: \" + error);\n            }\n        });\n\n        bgGeo.onHeartbeat(new TSHeartbeatCallback() {\n            @Override\n            public void onHeartbeat(HeartbeatEvent heartbeatEvent) {\n                Log.i(TAG, \"[heartbeat] \" + heartbeatEvent.toJson());\n            }\n        });\n\n        // Finally, signal #ready to the SDK.\n        bgGeo.ready(new TSCallback() {\n            @Override public void onSuccess() {\n                Log.i(TAG, \"[ready] success\");\n                if (!config.getEnabled()) {\n                    // Start tracking immediately (if not already).\n                    bgGeo.start();\n                }\n            }\n            @Override public void onFailure(String error) {\n                Log.i(TAG, \"[ready] FAILURE: \" + error);\n            }\n        });\n    }\n}\n```\n\n\n## :large_blue_diamond: Demo Application\n\nThis repo hosts demo apps for both iOS and Android.  Start by cloning this repo.\n\n- ### iOS\nIn XCode, open the project at **`/ios/BackgroundGeolocation/BackgroundGeolocation.xcworkspace`** and launch the **`Demo`** target.\n\n- ### Android\nIn Android Studio, open the project at **`/android`** and launch the **`app`** target.\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2018 Chris Scott, Transistor Software\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransistorsoft%2Fnative-background-geolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransistorsoft%2Fnative-background-geolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransistorsoft%2Fnative-background-geolocation/lists"}