{"id":22860057,"url":"https://github.com/reelyactive/ble-ios-sdk","last_synced_at":"2025-04-30T17:46:36.285Z","repository":{"id":28873832,"uuid":"32398143","full_name":"reelyactive/ble-ios-sdk","owner":"reelyactive","description":null,"archived":false,"fork":false,"pushed_at":"2017-01-23T18:30:34.000Z","size":67,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-24T20:22:30.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reelyactive.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-03-17T14:26:19.000Z","updated_at":"2017-07-22T01:01:42.000Z","dependencies_parsed_at":"2022-08-20T18:50:58.605Z","dependency_job_id":null,"html_url":"https://github.com/reelyactive/ble-ios-sdk","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fble-ios-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fble-ios-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fble-ios-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fble-ios-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/ble-ios-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251754305,"owners_count":21638492,"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","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":"2024-12-13T09:08:48.883Z","updated_at":"2025-04-30T17:46:36.261Z","avatar_url":"https://github.com/reelyactive.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"RABeaconManager\n=============\n\nRABeaconManager is an easy to use library that allows you to detect Bluetooth Beacons and iBeacons in the foreground and background, doing all the hard work for you.\n\nInstallation with CocoaPods\n---------------------------\n[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, that greatly simplifies the use of 3rd party libraries. For more information see the [Get Started guide](http://guides.cocoapods.org/using/getting-started.html).\n\nTo add BeaconManager to you project add the following line to your Podfile:\n```ruby\npod \"BeaconManager\"\n```\n\nHow to get started\n------------------\nTo import the Beacon manager code:\n```Objective-C\n#import \"RABeacons.h\"\n```\nThis imports all files needed in one go.\n\nThe preferred location for setting up the BeaconManger is from your App Delegate's ```application:didFinishLaunchingWithOptions:```,  this allows you to update the BeaconManager settings each time your app is launched.\n\nThis code sets up the BeaconManager to scan for a Beacon using a given UDID.\n```Objective-C\nif ([RABeaconManager sharedManager].beaconServices.count != 1)\n{\n  [[RABeaconManager sharedManager] removeAllServices];\n\n  RABeaconService *beaconService = [[RABeaconService alloc] initWithName:@\"Test Beacon\"\n  uuid:[[NSUUID alloc] initWithUUIDString:@\"7265656C-7941-6374-6976-652055554944\"]];\n  [[RABeaconManager sharedManager] addBeaconService:beaconService];\n}\n\n[[RABeaconManager sharedManager] setBeaconDetection:YES iBeacons:NO inBackground:YES];\n```\n\nTo be notified as soon as a Beacon or iBeacon is detected add the following code in the appropriate location:\n\n```Objective-C\n[[NSNotificationCenter defaultCenter] addObserver:self\nselector:@selector(beaconsDetectedUpdate:)\nname:BeaconManagerBeaconsDetectedChangedNotification\nobject:nil];\n```\n\nDon't forget to implement the handler for the notification:\n\n```Objective-C\n- (void)beaconsDetectedUpdate:(NSNotification *)notification\n{\n// Beacons array did update\n// check [RABeaconManger sharedManager].detectedBeacons for any beacons in range\n}\n```\n\nOnce you are done with scanning, you can easily stop it by calling:\n```Objective-C\n[[RABeaconManager sharedManager] removeAllServices];\n```\n\nFor more information read the **Documentation** or the **Demo Project**.\n\nAdvertising your app\n------------------\nIn order to have your application advertise as a beacon, you have to make sure you set a few variables (this is an example, please use your own values !):\n```Objective-C\n[RABeaconManager sharedManager].peripheralName = @\"Test Beacon\";\n[RABeaconManager sharedManager].peripheralServiceUUID = @\"00000000-0000-0000-0000-000000000000\";\n```\nThen, you can enable advertising by calling:\n```Objective-C\n[RABeaconManager sharedManager].advertisePeripheralWhenBeaconDetected = YES;\n```\nAnd you can disable it by calling:\n```Objective-C\n[RABeaconManager sharedManager].advertisePeripheralWhenBeaconDetected = NO;\n```\n\nDon't forget keys !\n------------------\nFor detecting Beacons in the background you will need to add the UIBackgroundModes\n\n```\nbluetooth-central\n```\n\nkey to your application's `info.plist`.\n\nTo detect iBeacons in the background you will need to add the UIBackgroundModes\n\n```\nlocation\n```\n\nkey to your application's `info.plist`.\n\nFor advertising a Beacon from the app in the background once a Beacon has been detected, you will need to add the UIBackgroundModes\n\n```\nbluetooth-peripheral\n```\nkey to your application's `info.plist`.\n\nSince iOS 8, don't forget to fill out the\n\n```\nNSLocationAlwaysUsageDescription\nNSLocationWhenInUseUsageDescription\n```\n\nkeys where needed.\n\nDemo project\n-----------\nFor information on how to use the library the [documentation](http://cocoadocs.org/docsets/BeaconManager) should be sufficient, but if not a Demo project is provided that allows you to detect Beacons and iBeacons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fble-ios-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fble-ios-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fble-ios-sdk/lists"}