{"id":13995412,"url":"https://github.com/insidegui/MultipeerKit","last_synced_at":"2025-07-22T21:32:53.072Z","repository":{"id":37762586,"uuid":"243799765","full_name":"insidegui/MultipeerKit","owner":"insidegui","description":"MultipeerConnectivity + Codable = ❤️","archived":false,"fork":false,"pushed_at":"2024-04-15T17:31:54.000Z","size":2406,"stargazers_count":1100,"open_issues_count":5,"forks_count":71,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-11-21T04:33:57.661Z","etag":null,"topics":["ios","macos","peer-to-peer","swift-library","tvos"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insidegui.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-28T15:57:34.000Z","updated_at":"2024-11-21T00:24:04.000Z","dependencies_parsed_at":"2024-01-10T19:31:31.725Z","dependency_job_id":"44ae0416-5182-4fd5-973d-e0694068069d","html_url":"https://github.com/insidegui/MultipeerKit","commit_stats":{"total_commits":52,"total_committers":11,"mean_commits":"4.7272727272727275","dds":0.3076923076923077,"last_synced_commit":"cb78d2c32498f87d398b069052bd5555e29f1fe0"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FMultipeerKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FMultipeerKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FMultipeerKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insidegui%2FMultipeerKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insidegui","download_url":"https://codeload.github.com/insidegui/MultipeerKit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177948,"owners_count":17743208,"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":["ios","macos","peer-to-peer","swift-library","tvos"],"created_at":"2024-08-09T14:03:23.463Z","updated_at":"2024-11-29T17:31:41.521Z","avatar_url":"https://github.com/insidegui.png","language":"Swift","readme":"# MultipeerKit\n\nA high-level abstraction built on top of the MultipeerConnectivity framework, which allows iOS, macOS and tvOS devices to exchange data between them over Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth.\n\n## Sample app\n\nCheck the example folder for a sample implementation.\n\n![Sample](../assets/demo.gif?raw=true)\n\n## Info.plist configuration\n\nIn order for MultipeerKit to work when running on iOS 14, you will have to include two keys in your app's Info.plist file.\n\nThe keys are `Privacy - Local Network Usage Description` (`NSLocalNetworkUsageDescription`) and `Bonjour services` (`NSBonjourServices`).\n\nFor the privacy key, include a human-readable description of what benefit the user gets by allowing your app to access devices on the local network.\n\nThe Bonjour services key is an array of service types that your app will browse for. For MultipeerKit, the entry should be in the format `_servicename._tcp`, where `servicename` is the `serviceType` you've set in your `MultipeerConfiguration`. If you're using the default configuration, the value of this key should be `_MKSVC._tcp`.\n\n**If you do not configure the above keys properly, then MultipeerKit won't work.**\n\n## Usage\n\nThe main class in this library is `MultipeerTransceiver`, which does both the sending and receiving aspects of the multipeer communication.\n\nMultipeerKit can transmit and receive anything that conforms to the `Codable` protocol, which makes it easy for you to define your own message types.\n\n```swift\n// Create a transceiver (make sure you store it somewhere, like a property)\nlet transceiver = MultipeerTransceiver()\n\n// Start it up!\ntransceiver.resume()\n\n// Configure message receivers\ntransceiver.receive(SomeCodableThing.self) { payload, sender in\nprint(\"Got my thing from \\(sender.name)! \\(payload)\")\n}\n\n// Broadcast message to peers\nlet payload = SomeEncodableThing()\ntransceiver.broadcast(payload)\n```\n\nFor more information on how to use MultipeerKit, check out the [documentation](https://multipeerkit.rambo.codes).\n\n## Integrating\n\nMultipeerKit is a Swift package, to use it in your project, add this to your `Package.swift` file:\n\n```swift\nlet package = Package(\n    ...\n    dependencies: [\n        .package(url: \"https://github.com/insidegui/MultipeerKit.git\", from: \"0.4.0\")\n    ],\n    ...\n)\n```\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsidegui%2FMultipeerKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsidegui%2FMultipeerKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsidegui%2FMultipeerKit/lists"}