Ana içeriğe geç

Kurulum

AIBuds SDK'yı CocoaPods ile kurun. Uygulamanızın hangi özelliklere ihtiyaç duyduğu kesin değilse tam kurulumla başlayın.

Gereksinimler

  • iOS 13.0 veya üzeri
  • Xcode 26.0 veya üzeri
  • CocoaPods 1.16.0 veya üzeri

Kurulum Yöntemini Seçin

Daha az bağımlılık

Modüler Kurulum

Yalnızca ürününüzde kullandığınız özellikleri seçin. Gerekli SDK katmanlarını ve üçüncü taraf bağımlılıklarını CocoaPods otomatik olarak kurar.

AI destekli kurulum

AI kodlama asistanınızla entegre edin

Kurulum yöntemini seçin ve kısa istemi proje çalışma alanındaki AI asistanınıza yapıştırın.

AIBudsSDK/AllInOne ile tüm SDK’yı kurun.

https://docs-aibuds.github.io/tr/skills/integrate-aibuds-sdk adresini okuyup yönergeleri izleyin. AIBudsSDK/AllInOne paketini bu iOS projesine entegre edin ve doğrulayın.
AIBuds Skills’e göz at

1. Adım: SDK'yı Podfile'a Ekleyin

Her AIBudsSDK Pod bildirimi Git kaynağını:

Ruby
:git => 'https://github.com/topstepsmart/AIBuds-SDK-iOS.git'

veya yerel SDK yolunu belirtmelidir:

Ruby
:path => '../AIBuds-SDK-iOS'

Aşağıdaki örneklerde source belirtilmemiştir. Projenize uygun biçimi ekleyin.

Ruby
platform :ios, '13.0'

target 'YourTargetName' do
  pod 'AIBudsSDK/AllInOne'
end
Tüm modülleri görüntüle
Ruby
# Installing only AIBudsSDK selects Core.
# It does not include ABMate, an AI provider, or optional features.
pod 'AIBudsSDK'

# Base SDK types, Bluetooth orchestration, models, and protocols.
# Includes: Foundation, Log/Core
pod 'AIBudsSDK/Core'

# ABMate BLE device communication.
# Includes: Core, GCDWebServer, libopus
pod 'AIBudsSDK/ABMate'

# Shared audio-session and voice-activity processing for AI.
# Includes: Core, tenVad
pod 'AIBudsSDK/Audio'

# Core logging without the XLFacility backend.
# Includes: zipzap
pod 'AIBudsSDK/Log/Core'

# Persistent logging and local log-browser integration.
# Includes: Log/Core, iOSLogBrowserSDK
pod 'AIBudsSDK/Log/XLFacility'
Ruby
# Optional OTA protocol plugins. Install only the implementations required by
# your devices, then register each plugin before connecting a device.
pod 'AIBudsSDK/FitCloudProOTA'
pod 'AIBudsSDK/JieliOTA'
Ruby
# AI facade, sessions, reports, and provider routing.
# Includes: AI/Foundation, Core, WCDB.swift
pod 'AIBudsSDK/AI/Core'

# StarBurst AI services.
# Includes: AI/Core, Audio, StarBurst SDK, LAME, libopus, libogg
pod 'AIBudsSDK/AI/StarBurst'

# MLTCloud AI services.
# Includes: AI/Core, Audio, MagicHelper, Microsoft Speech, LAME, libopus, libogg
pod 'AIBudsSDK/AI/MltCloud'

# Local AI diagnostic dashboard.
# Includes: AI/Core, WCDB.swift, GCDWebServer, YYWebImage, iOSLogBrowserSDK
pod 'AIBudsSDK/AI/Dashboard'
Ruby
# On-device voice assistant authentication bridge.
# Includes: Core, MZEncryptSDK, OpenSSL
pod 'AIBudsSDK/VoiceAssistant'

# Persisted crash-report capture and access.
# Includes: CrashReporter framework
pod 'AIBudsSDK/CrashReporter'

# Native RTSP playback and RTMP streaming.
# Includes: Log, FFmpeg, LiveStream resource bundle
pod 'AIBudsSDK/LiveStream'

# Post-processing for imported six-axis video.
# Includes: Core, bundled AWEISIMG implementation
pod 'AIBudsSDK/VideoStabilization'

Birleşik subspec'ler

Ruby
# Log/Core + Log/XLFacility
pod 'AIBudsSDK/Log'

# AI/Foundation + AI/Core + both providers + AI/Dashboard
pod 'AIBudsSDK/AI'

# Log + ABMate + FitCloudProOTA + JieliOTA + AI + VoiceAssistant
# + CrashReporter + LiveStream + VideoStabilization
pod 'AIBudsSDK/AllInOne'

# Do not normally select these implementation layers directly:
# AIBudsSDK/Foundation
# AIBudsSDK/AI/Foundation
# AIBudsSDK/ThirdParty/*

2. Adım: Gerekli Podfile Hook'larını Ekleyin

Aşağıdaki bloğu Podfile'a bir kez ekleyin. Gerekli dynamic framework'leri yapılandırır, desteklenmeyen private header import'unu kaldırır ve ikili dağıtım uyumluluğunu etkinleştirir.

Ruby
dynamic_frameworks = ['AFNetworking', 'WCDB.swift', 'WCDBOptimizedSQLCipher', 'SocketRocket']
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if dynamic_frameworks.include?(pod.name)
      def pod.static_framework?; false; end
      def pod.build_type; Pod::BuildType.dynamic_framework; end
    end
  end
end

def patch_private_header(installer, pod_subdir_pairs)
  pod_subdir_pairs.each do |pod_name, sub_dir|
    target_dir = sub_dir ? File.join(installer.sandbox.pod_dir(pod_name), sub_dir) : installer.sandbox.pod_dir(pod_name)
    puts target_dir
    next unless Dir.exist?(target_dir)

    private_header_import = '#import <netinet6/in6.h>'
    Dir.glob(File.join(target_dir, '**', '*.{h,m}')).each do |file_path|
      puts file_path
      next unless File.exist?(file_path)

      file_content = File.read(file_path)
      next unless file_content.include?(private_header_import)

      original_mode = File.stat(file_path).mode
      File.chmod(original_mode | 0o200, file_path)
      File.write(file_path, file_content.gsub(private_header_import, ''))
      File.chmod(original_mode, file_path)
      puts "patched #{pod_name} private header import: #{File.basename(file_path)}"
    end
  end
end

post_install do |installer|
  patch_private_header(installer, {'AFNetworking' => 'AFNetworking', 'Reachability' => nil })
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
    end
  end
end

3. Adım: Kurun ve Workspace'i Açın

CocoaPods'u çalıştırın ve .xcodeproj yerine oluşturulan workspace'i açın:

BASH
pod install
open YourProject.xcworkspace

4. Adım: İzinleri Ekleyin

Cihaz Bağlantısı İçin Zorunlu

İki Bluetooth kullanım açıklamasını da Info.plist dosyasına ekleyin:

XML
<key>NSBluetoothWhileInUseUsageDescription</key>
<string>Your app needs Bluetooth access while in use to connect to AIBuds devices.</string>

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Your app needs Bluetooth access to communicate with AIBuds devices.</string>

Bluetooth key'lerinden biri eksikse AIBudsSDK.initialize, false döndürür.

Yalnızca Kullandığınız Özellikler İçin Ekleyin

ÖzellikEk yapılandırma
iPhone tarafında ses kaydıMikrofon kullanım açıklaması
Canlı yayın, Camera OTA veya cihaz hotspot'u üzerinden medya indirmeYerel Ağ kullanım açıklaması, Bonjour service, Access WiFi Information ve Hotspot Configuration
Arka planda Bluetooth veya AI görüşmeleriEtkin davranış için gereken Background Modes
İsteğe bağlı izin ve entitlement örneklerini görüntüle

Mikrofon

XML
<key>NSMicrophoneUsageDescription</key>
<string>Your app needs microphone access for simultaneous interpretation and conversation translation.</string>

Yerel Ağ ve Bonjour

XML
<key>NSLocalNetworkUsageDescription</key>
<string>Your app needs local network access to stream live video, perform device updates, and download recordings and photos.</string>

<key>NSBonjourServices</key>
<array>
  <string>_dummy._tcp</string>
</array>

Arka Plan Modları

XML
<key>UIBackgroundModes</key>
<array>
  <string>bluetooth-central</string>
  <string>push-to-talk</string>
  <string>audio</string>
</array>

Hotspot entitlement'ları

Uygulama target'ının Signing & Capabilities sekmesinde Access WiFi Information ve Hotspot Configuration seçeneklerini etkinleştirin:

XML
<key>com.apple.developer.networking.wifi-info</key>
<true/>

<key>com.apple.developer.networking.HotspotConfiguration</key>
<true/>

5. Adım: Kurulumu Doğrulayın

  • Oluşturulan .xcworkspace dosyasını derleyin.
  • Target'ın kurulu AIBuds framework'lerini içe aktarabildiğini doğrulayın.
  • Zorunlu Bluetooth key'lerini ekledikten sonra AIBudsSDK.initialize çağrısının true döndürdüğünü doğrulayın.
  • SDK'yı başlatmak ve cihaz bağlamak için Hızlı Başlangıç bölümüne geçin.

Kurulum veya başlatma başarısızsa Pod cache'lerini ya da lockfile'ları değiştirmeden önce Yaygın Sorunlar bölümündeki kontrolleri uygulayın.