{"id":21373697,"url":"https://github.com/maxxfrazer/MultipeerHelper","last_synced_at":"2025-07-13T08:30:35.980Z","repository":{"id":36435898,"uuid":"223660736","full_name":"maxxfrazer/MultipeerHelper","owner":"maxxfrazer","description":"A light swift wrapper around the iOS MultipeerConnectivity framework. Including an example project using RealityKit's MultipeerConnectivityService.","archived":false,"fork":false,"pushed_at":"2023-04-19T16:26:40.000Z","size":418,"stargazers_count":105,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-01T17:59:15.949Z","etag":null,"topics":["arkit","arkit3","arsession","augmented-reality","collaborative-session","ios","mixed-reality","multipeer-connectivity","multipeerconnectivity","multiplayer","realitykit","swift","swift-package-manager","swiftpm"],"latest_commit_sha":null,"homepage":"https://maxxfrazer.github.io/MultipeerHelper/documentation/multipeerhelper/","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/maxxfrazer.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-23T22:21:35.000Z","updated_at":"2025-05-22T08:59:59.000Z","dependencies_parsed_at":"2024-10-27T10:55:05.804Z","dependency_job_id":"c0254401-7bce-4fd0-9f5d-8cb12f1bbd78","html_url":"https://github.com/maxxfrazer/MultipeerHelper","commit_stats":{"total_commits":43,"total_committers":1,"mean_commits":43.0,"dds":0.0,"last_synced_commit":"ea73ccdcbc34f967a5b7df10674eae7ea52aa803"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/maxxfrazer/MultipeerHelper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxxfrazer%2FMultipeerHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxxfrazer%2FMultipeerHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxxfrazer%2FMultipeerHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxxfrazer%2FMultipeerHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxxfrazer","download_url":"https://codeload.github.com/maxxfrazer/MultipeerHelper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxxfrazer%2FMultipeerHelper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265109673,"owners_count":23712730,"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":["arkit","arkit3","arsession","augmented-reality","collaborative-session","ios","mixed-reality","multipeer-connectivity","multipeerconnectivity","multiplayer","realitykit","swift","swift-package-manager","swiftpm"],"created_at":"2024-11-22T08:29:29.005Z","updated_at":"2025-07-13T08:30:35.675Z","avatar_url":"https://github.com/maxxfrazer.png","language":"Swift","readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/v/release/maxxfrazer/MultipeerHelper?color=orange\u0026label=SwiftPM\u0026logo=swift\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20tvOS-lightgrey\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Swift-5.2-orange?logo=swift\"/\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/maxxfrazer/MultipeerHelper\"/\u003e\n  \u003cimg src=\"https://github.com/maxxfrazer/MultipeerHelper/workflows/build/badge.svg?branch=main\"/\u003e\n  \u003cimg src=\"https://github.com/maxxfrazer/MultipeerHelper/workflows/swiftlint/badge.svg?branch=main\"/\u003e\n\u003c/p\u003e\n\n![MultipeerHelper Header](https://github.com/maxxfrazer/MultipeerHelper/blob/main/media/MultipeerHelper-Header.png?raw=true)\n\n# MultipeerHelper\n\nMultipeerConnectivity can be a big pill for developers to swallow. This package aims to simplify the creation of a multi-peer experience, while still delivering the full power of Apple's API.\n\n## Installation\n\nThis is a Swift Package, and can be installed via Xcode with the URL of this repository:\n\n`git@github.com:maxxfrazer/MultipeerHelper.git`\n\n[For more information on how to add a Swift Package using Xcode, see Apple's official documentation.](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app)\n\n\n## Usage\n\nTo use this package, all you have to do is import `MultipeerHelper` and initialise the object:\n\n```swift\nself.multipeerHelp = MultipeerHelper(\n  serviceName: \"helper-test\"\n)\n```\n\nBecause MultipeerConnectivity looks over your local network to find other devices to connect with, there are a few new things to include since iOS 14.\n\nThe first thing, is to include the key `NSLocalNetworkUsageDescription` in your app's Info.plist, along with a short text explaining why you need to use the local network. For example \"This application needs access to the local network to find opponents.\".\n\nAs well as the above, you also need to add another key, `NSBonjourServices`. Bonjour services is an array of Bonjour service types.\nFor example, if your serviceName is \"helper-test\", you will need to add `_helper-test._tcp` and `_helper-test._udp`.\n\nThe two above keys are included in [the Example Project](MultipeerHelper+Example).\n\nSee full documentation here:\u003cbr\u003e\nhttps://maxxfrazer.github.io/MultipeerHelper/documentation/multipeerhelper/\n\n### RealityKit\n\nTo extend this to RealityKit's synchronization service, simply add the following:\n\n```swift\nself.arView.scene.synchronizationService = self.multipeerHelp.syncService\n```\n\nAnd also make sure that your ARConfiguration's isCollaborationEnabled property is set to true.\n\nTo make sure RealityKit's synchronizationService runs properly, you must ensure that the RealityKit version installed on any two devices are compatible.\n\nBy default, any OS using MultipeerHelper that can install RealityKit (iOS, iPadOS and macOS) will have a key added to the discoveryInfo.\nTo use this easily, you can add the `shouldSendJoinRequest` method to your `MultipeerHelperDelegate`, and make use of the `checkPeerToken` which is accessible to any class which inherits the `MultipeerHelperDelegate`. Here's an example:\n\n```swift\nextension RealityViewController: MultipeerHelperDelegate {\n  func shouldSendJoinRequest(\n    _ peer: MCPeerID,\n    with discoveryInfo: [String: String]?\n  ) -\u003e Bool {\n    self.checkPeerToken(with: discoveryInfo)\n  }\n}\n```\n\nThis method is used in [the Example Project](MultipeerHelper+Example).\n\n### Initializer Parameters\n\n#### serviceName\nThis is the type of service to advertise or search for. Due to how MultipeerConnectivity uses it, it should have the following restrictions:\n - Must be 1–15 characters long\n - Can contain only ASCII lowercase letters, numbers, and hyphens\n - Must contain at least one ASCII letter\n - Must not begin or end with a hyphen\n - Must not contain hyphens adjacent to other hyphens.\n\n#### sessionType (default: `.both`)\nThis lets the service know if it should be acting as a service `host` (advertiser), `peer` (browser), or in a scenario where it doesn't matter, `both`. The default for this parameter is `both`, which is the scenario where all devices want to just connect to each other with no questions asked.\n\n#### peerName (default: `UIDevice.current.name`)\nString name of your device on the network.\n\n#### encryptionPreference (default: `.required`)\nencryptionPreference is how data sent over the network are encrypted.\n\n#### delegate (default: `nil`)\nThis delegate object will inherit the `MultipeerHelperDelegate` protocol, which can be used for all the handling of transferring data round the network and seeing when others join and leave.\n","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["AR-VR"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxxfrazer%2FMultipeerHelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxxfrazer%2FMultipeerHelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxxfrazer%2FMultipeerHelper/lists"}