View in English

  • Apple Developer
    • 今すぐ始める

    「今すぐ始める」を詳しく見る

    • 概要
    • 学ぶ
    • Apple Developer Program

    最新情報

    • 最新ニュース
    • Hello Developer
    • プラットフォーム

    プラットフォームを詳しく見る

    • Appleプラットフォーム
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    特集

    • デザイン
    • 配信
    • ゲーム
    • アクセサリ
    • Web
    • Home
    • CarPlay
    • テクノロジー

    テクノロジーを詳しく見る

    • 概要
    • Xcode
    • Swift
    • SwiftUI

    特集

    • アクセシビリティ
    • App Intent
    • Apple Intelligence
    • ゲーム
    • 機械学習とAI
    • セキュリティ
    • Xcode Cloud
    • コミュニティ

    コミュニティを詳しく見る

    • 概要
    • 「Appleに相談」イベント
    • コミュニティによるイベント
    • デベロッパフォーラム
    • オープンソース

    特集

    • WWDC
    • Swift Student Challenge
    • デベロッパストーリー
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Center
    • ドキュメント

    ドキュメントを詳しく見る

    • ドキュメントライブラリ
    • テクノロジー概要
    • サンプルコード
    • ヒューマンインターフェイスガイドライン
    • ビデオ

    リリースノート

    • 注目のアップデート
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • ダウンロード

    ダウンロードを詳しく見る

    • すべてのダウンロード
    • オペレーティングシステム
    • アプリ
    • デザインリソース

    特集

    • Xcode
    • TestFlight
    • フォント
    • SF Symbols
    • Icon Composer
    • サポート

    サポートを詳しく見る

    • 概要
    • ヘルプガイド
    • デベロッパフォーラム
    • フィードバックアシスタント
    • お問い合わせ

    特集

    • アカウントヘルプ
    • App Reviewガイドライン
    • App Store Connectヘルプ
    • 近日導入予定の要件
    • 契約およびガイドライン
    • システムステータス
  • クイックリンク

    • イベント
    • ニュース
    • Forum
    • サンプルコード
    • ビデオ
 

ビデオ

メニューを開く メニューを閉じる
  • コレクション
  • すべてのビデオ
  • 利用方法

その他のビデオ

  • 概要
  • Summary
  • コード
  • Bluetooth Channel Soundingによるアクセサリの発見

    Channel Soundingを使ってBluetoothアクセサリの距離と方向を認識する方法を学びましょう。新しいNearby Interaction APIとCore Bluetooth APIの詳細と、アクセサリ側で必要となる変更点について解説します。消費電力を最適化しながら、スムーズな体験と優れた応答性を実現できます。

    関連する章

    • 0:01 - Introduction
    • 0:50 - Overview
    • 3:17 - Core Bluetooth API
    • 4:34 - Nearby Interaction API
    • 7:05 - Hardware tips

    リソース

    • AccessorySetupKit
    • Nearby Interaction
    • Core Bluetooth
      • HDビデオ
      • SDビデオ

    関連ビデオ

    WWDC24

    • AccessorySetupKitについて

    WWDC21

    • サードパーティ製アクセサリとのNearbyインタラクション
  • このビデオを検索
    • 3:43 - Start a Core Bluetooth Channel Sounding session

      import CoreBluetooth
      
      func isChannelSoundingSupported() -> BOOL {
          guard centralManager.state == .poweredOn else { return }
          if #available(iOS 27.0, *) {
              // Check current device supports Bluetooth Channel Sounding
              return CBCentralManager.supportsFeatures(.channelSounding)
          }
      }
      
      func startChannelSounding(_ peripheral: CBPeripheral) {
          guard peripheral.isConnected else { return }
          if #available(iOS 27.0, *) {  
              // Step 1: Create a CBChannelSoundingSessionConfiguration
              let config = CBChannelSoundingSessionConfiguration(role: .initiator)
      
              // Step 2: Start the channel sounding session
              peripheral.startChannelSoundingSession(config)
          }
      }
    • 4:09 - Receive distance results and cancel a session

      import CoreBluetooth
      
      // Receive distance results
      func peripheral(_ peripheral: CBPeripheral,
                      didReceive results: CBChannelSoundingProcedureResults?,
                      error: Error?) {
          guard let results = results else { return }
      
          let distance = results.distance
          
          // Do something with distance
      }
      
      // Cancel a Channel Sounding session
      func cancelChannelSounding(_ peripheral: CBPeripheral) {
          guard peripheral.isConnected else { return }
          if #available(iOS 27.0, *) {
              // Cancel the channel sounding session
              peripheral.cancelChannelSoundingSession(config)
          }
      }
      
      func peripheral(_ peripheral: CBPeripheral,
                      didCompleteChannelSoundingSession error: Error?) {   
          // Session is complete
      }
    • 4:41 - Start a Nearby Interaction Channel Sounding session

      import CoreBluetooth
      import NearbyInteraction
      
      // Configure a Nearby Interaction Channel Sounding session
      func startChannelSoundingThroughNearbyInteraction(_ peripheral: CBPeripheral) {
          if #available(iOS 27.0, *) {        
              // Step 1: Check current device supports Bluetooth Channel Sounding
              guard NISession.deviceCapabilities.supportsBluetoothChannelSounding else { return }
      
              // Step 2: Create an NINearbyAccessoryConfiguration
              let config = NINearbyAccessoryConfiguration(
                  bluetoothChannelSoundingIdentifier: peripheral.identifier, 
                  previousChannelSoundingIdentifier: nil)
      
              // Step 3: Enable camera assistance for direction support
              if NISession.deviceCapabilities.supportsCameraAssistance { 
                  config.isCameraAssistanceEnabled = true
              }
          }
      }
    • 5:19 - Run a Nearby Interaction Channel Sounding session

      import CoreBluetooth
      import NearbyInteraction
      
      // Run a Nearby Interaction Channel Sounding session
      func runChannelSoundingThroughNearbyInteraction(_ config: NINearbyAccessoryConfiguration) {
          // Create an NISession
          let session = NISession()
          session.delegate = self
          // Run the NISession with the accessory configuration
          session.run(config)
      }
      
      // Improve Nearby Interaction direction outputs
      func updateAccessoryMotionState(_ isMoving: Bool) {
          NIMotionActivityState motionState = isMoving ? .moving : .stationary
          
          // Tell NISession about.the accessory's motion state
          session.updateMotionState(motionState, forObjectWithToken: object.discoveryToken)
      }
      
      // Receive NISession updates
      func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObjects]) {   
          guard let object = nearbyObjects.first else { return }
      
          if let distance = object.distance {
              // Do something with distance
          }
      
          if let direction = object.horizontalAngle {
              // Do something with horizontal angle
          }
      }
    • 0:01 - Introduction
    • Discover the three aspects of Bluetooth Channel Sounding that will be discussed in this video.

    • 0:50 - Overview
    • Find inspiration for using Bluetooth Channel Sounding.

    • 3:17 - Core Bluetooth API
    • Learn how to get distance with the Core Bluetooth API.

    • 4:34 - Nearby Interaction API
    • Get distance and direction with the Nearby Interaction API.

    • 7:05 - Hardware tips
    • Understand the hardware requirements for Bluetooth Channel Sounding.

Developer Footer

  • ビデオ
  • WWDC26
  • Bluetooth Channel Soundingによるアクセサリの発見
  • メニューを開く メニューを閉じる
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    メニューを開く メニューを閉じる
    • アクセシビリティ
    • アクセサリ
    • Apple Intelligence
    • App Extension
    • App Store
    • オーディオとビデオ(英語)
    • 拡張現実
    • デザイン
    • 配信
    • 教育
    • フォント(英語)
    • ゲーム
    • ヘルスケアとフィットネス
    • アプリ内課金
    • ローカリゼーション
    • マップと位置情報
    • 機械学習とAI
    • オープンソース(英語)
    • セキュリティ
    • SafariとWeb(英語)
    メニューを開く メニューを閉じる
    • 英語ドキュメント(完全版)
    • 日本語ドキュメント(一部トピック)
    • チュートリアル
    • ダウンロード
    • フォーラム(英語)
    • ビデオ
    Open Menu Close Menu
    • サポートドキュメント
    • お問い合わせ
    • バグ報告
    • システム状況(英語)
    メニューを開く メニューを閉じる
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles(英語)
    • フィードバックアシスタント
    メニューを開く メニューを閉じる
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(英語)
    • Mini Apps Partner Program
    • News Partner Program(英語)
    • Video Partner Program(英語)
    • セキュリティ報奨金プログラム(英語)
    • Security Research Device Program(英語)
    Open Menu Close Menu
    • Appleに相談
    • Apple Developer Center
    • App Store Awards(英語)
    • Apple Design Awards
    • Apple Developer Academy(英語)
    • WWDC
    最新ニュースを読む。
    Apple Developerアプリを入手する。
    Copyright © 2026 Apple Inc. All rights reserved.
    利用規約 プライバシーポリシー 契約とガイドライン