{"id":19331488,"url":"https://github.com/netguru/blueswift","last_synced_at":"2025-07-11T14:07:23.437Z","repository":{"id":33083513,"uuid":"116670675","full_name":"netguru/BlueSwift","owner":"netguru","description":"Swift framework for easy connection with Bluetooth peripherals.","archived":false,"fork":false,"pushed_at":"2024-07-09T05:09:20.000Z","size":3233,"stargazers_count":173,"open_issues_count":1,"forks_count":32,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-03T04:05:15.101Z","etag":null,"topics":["bluetooth","bluetooth-connection","bluetooth-low-energy","bluetooth-peripherals","corebluetooth","ios","iphone","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/netguru.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2018-01-08T11:53:36.000Z","updated_at":"2025-03-07T11:30:55.000Z","dependencies_parsed_at":"2023-02-14T01:17:02.712Z","dependency_job_id":"770ce5eb-f63e-4226-a283-60c77d0db862","html_url":"https://github.com/netguru/BlueSwift","commit_stats":{"total_commits":206,"total_committers":11,"mean_commits":"18.727272727272727","dds":0.3203883495145631,"last_synced_commit":"dacfbd87b80ca2593ab2c402c551eea3c8a56821"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FBlueSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FBlueSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FBlueSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FBlueSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netguru","download_url":"https://codeload.github.com/netguru/BlueSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018061,"owners_count":21034048,"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":["bluetooth","bluetooth-connection","bluetooth-low-energy","bluetooth-peripherals","corebluetooth","ios","iphone","swift"],"created_at":"2024-11-10T02:40:31.592Z","updated_at":"2025-04-09T10:10:32.189Z","avatar_url":"https://github.com/netguru.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](./logo.png)\n\n\u003cbr/\u003e\n\n![](https://img.shields.io/badge/swift-4.2-orange.svg)\n![](https://img.shields.io/github/release/netguru/BlueSwift.svg)\n![](https://img.shields.io/badge/carthage-compatible-green.svg)\n![](https://img.shields.io/badge/cocoapods-compatible-green.svg)\n![](https://app.bitrise.io/app/23a07b63b3f55f97/status.svg?token=Rt_2gKUavbR8LQ7PVuTbYg\u0026branch=master)\n\nEasy to use Bluetooth open source library brought to you by Netguru.\u003cbr/\u003e\n🤟 Probably the easiest way to interact with bluetooth peripherals 🤟\n\n## 🤹🏻‍♂️ Features\n\n- [x] Handles connection with remote peripherals.\n- [x] Handles advertising an iPhone as Bluetooth LE peripheral.\n- [x] Closure based read/write/notify requests.\n- [x] Built in data conversion method with `Command` wrapper.\n\n##  📲  Connection:\n\nBelow you can find an easy code sample to connect to the peripheral.\u003cbr/\u003e\nReally thats all that is needed 🍾🍾\n\n```swift\nlet connection = BluetoothConnection.shared\nlet characteristic = try! Characteristic(uuid: \"your_characteristic_uuid\", shouldObserveNotification: true)\nlet service = try! Service(uuid: \"your_service_uuid\", characteristics: [characteristic])\nlet configuration = try! Configuration(services: [service], advertisement: \"your_advertising_uuid\")\nlet peripheral = Peripheral(configuration: configuration)\nconnection.connect(peripheral) { error in\n\t// do awesome stuff\n}\n```\n\n## 📡 Advertisement:\n\nBelow you can find a code sample the setup the iPhone to advertise Bluetooth.\u003cbr/\u003e\nThat's all it takes to advertise one service containing one characteristic.\n\n```swift\nlet characteristic = try! Characteristic(uuid: \"your_characteristic_uuid\")\nlet service = try! Service(uuid: \"your_service_uuid\", characteristics: [characteristic])\nlet configuration = try! Configuration(services: [service], advertisement: \"your_service_uuid\")\nlet peripheral = Peripheral(configuration: configuration, advertisementData: [.localName(\"Test\"), .servicesUUIDs(\"your_service_uuid\")])\nadvertisement.advertise(peripheral: peripheral) { error in\n\t// oh no, something failed in that case          \n}\n```\n\n## 📟 📲 Data transfer:\n\nOf course data transfer is also possible, both for advertising and connection mode!\nBelow there are some basic examples, for more please see `More usage` section 👇🏻\n\n## Connection mode:\n\n```swift\nlet command = Command.utf8String(\"Hello world\")\nperipheral.write(command: command, characteristic: someCharacteristic, handler: { error in\n\t// written!\n})\nperipheral.read(characteristic, handler: { data, error in\n\t// read!\n})\n```\n\n## Advertisement mode:\n\n```swift\nlet command = Command.int8(3)\nadvertisement.update(command, characteristic: characteristic) { error in\n\t// data updated!\n}\nadvertisement.writeRequestCallback = { characteristic, data in\n\t// written!\n}\n```\n\n## ⚙️ More usage:\n\nFor more advanced usage check out documentation page at: https://netguru.github.io/BlueSwift/.\u003cbr/\u003e\nAlso feel free to check example project bundled with this repository! 👩🏼‍🏫 👨🏼‍🏫\nIt's a complete app that allows connection and sending text messages between two iPhones.\n\n## 🛠 Dependency management:\n\nBlueSwift can be drag'n dropped to the project directory,\u003cbr/\u003e\nbut what's more important it's supported by most common dependency management!\n\n### ![](https://img.shields.io/badge/cocoapods-compatible-green.svg)\n\nJust drop the line below to your Podfile:\n\n`pod 'BlueSwift'`\n\n(but probably you'd like to pin it to the nearest major release, so `pod 'BlueSwift' , '~\u003e 1.1.6'`)\n\n### ![](https://img.shields.io/badge/carthage-compatible-green.svg)\n\nThe same as with Cocoapods, insert the line below to your Cartfile:\n\n`github 'netguru/BlueSwift'`\n\n, or including version - `github 'netguru/BlueSwift' ~\u003e 1.1.6`\n\n## 📄 License\n\n(As all cool open source software, it's...)\u003cbr/\u003e\nLicensed under MIT license.\u003cbr/\u003e\n\nAlso it would be really nice if you could drop us a line about your usage!! 🚀🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2Fblueswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetguru%2Fblueswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2Fblueswift/lists"}