메일링 리스트에 가입하여 Nearby에 관한 소식 및 공지사항을 확인하세요.
시작하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
최신 버전의 Xcode 설치
프로젝트에서 Nearby Connection을 사용하려면 Xcode 13.0 이상이 필요합니다.
프로젝트에 Nearby Connections 패키지 추가
Xcode에는 기본 제공 패키지 관리자가 포함되어 있습니다. Xcode 프로젝트에 Nearby Connections를 추가하려면 File(파일) > Add Packages…(패키지 추가)를 선택하고 google/nearby
를 검색합니다. 그런 다음 패키지 추가를 클릭하고 프로세스가 완료될 때까지 기다립니다(몇 분 정도 걸릴 수 있음).
보호된 리소스에 대한 액세스 요청
근처 기기 연결은 광고, 검색, 연결, 데이터 전송을 위해 블루투스와 로컬 네트워크에 모두 액세스해야 합니다. 앱의 Info.plist
에서 필요한 각 리소스의 사용 설명을 제공합니다. 그렇지 않으면 리소스에 액세스하려는 시도가 실패하고 앱이 비정상 종료될 수도 있습니다.
필수 사용 설명 키:
NSBluetoothAlwaysUsageDescription
NSLocalNetworkUsageDescription
사용 설명 키 외에도 앱에서 탐색할 서비스 유형 목록이 포함된 NSBonjourServices
키도 추가해야 합니다.
추가해야 하는 유일한 서비스 유형은 앱의 서비스 ID의 SHA-256
해시에서 처음 12바이트를 가져와 생성할 수 있습니다.
다음 도구를 사용하여 이 값을 자동으로 생성할 수 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-13(UTC)
[null,null,["최종 업데이트: 2025-08-13(UTC)"],[],[],null,["# Get started\n\nInstall the latest version of Xcode\n-----------------------------------\n\nTo use Nearby Connection in your project,\n[Xcode](https://developer.apple.com/xcode/) **13.0 or later** is required.\n\nAdd the Nearby Connections package to your project\n--------------------------------------------------\n\nXcode comes with a built-in package manager. To add Nearby Connections to your\nXcode project, select **File** \\\u003e **Add Packages...** and search for\n`google/nearby`. Then click **Add Package** and wait for the process to complete\n(this may take a few minutes).\n\nRequest access to protected resources\n-------------------------------------\n\nNearby Connections needs access to both Bluetooth and the local network to\nadvertise, discover, make connections, and transfer data. Provide a usage\ndescription for each resource needed, in your app's `Info.plist`. If you don't,\nattempts to access the resource will fail, and might even cause your app to\ncrash.\n\nRequired usage description keys:\n\n- `NSBluetoothAlwaysUsageDescription`\n- `NSLocalNetworkUsageDescription`\n\nIn addition to usage description keys, an `NSBonjourServices` key with a list of\nthe service types that will be browsed by the app, will also need to be added.\nThe only service type that must be added can be generated by taking the first 12\nbytes of the `SHA-256` hash of your app's service ID.\n\nYou can use the following tool to automatically generate this value for you: \nService ID\nGenerate\n\n```\n\n```"]]