Pre-requisite

1. 앱의 네이티브 권한 설정

  • android>app>src>main>AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.audio.output" />
<uses-feature android:name="android.hardware.microphone" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
  • ios>Runner>info.plist

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) Camera Usage!</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) Microphone Usage!</string>
  • ios>Podfile (for permission handler 참고)


post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    # Start of the permission_handler configuration
    target.build_configurations.each do |config|
   
       #  Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
  
        
        # dart: PermissionGroup.camera
        'PERMISSION_CAMERA=1',
  
        # dart: PermissionGroup.microphone
        'PERMISSION_MICROPHONE=1',
         
        # dart: PermissionGroup.notification
        'PERMISSION_NOTIFICATIONS=1', 
           
        # dart: PermissionGroup.bluetooth
        'PERMISSION_BLUETOOTH=1',
      ]
  
    end 
    # End of the permission_handler configuration

2. 패키지 설치

  • pubspec.yaml

omnitalk_sdk: ^2.0.0
flutter_webrtc: ^0.9.34

3. 최소 지원 사양

  • Flutter >= 3.1.0

  • Dart >= 2.19

  • Android API >=21

  • IOS>= 11

Android와 ios 설정은 다음을 참고하시면 됩니다.

  • android > add > build.gradle

defaultConfig {
   minSdkVersion 21
}
  • ios > Podfile

platform :ios, '11.0'

4. 앱 개발 공통 사항

Step 0. SDK 객체 초기화

콘솔에서 발급받은 Service Id와 Service Key로 SDK를 초기화 합니다. 해당 정보는 노출되지 않도록 주의하여야 합니다. 초기화된 SDK 객체는 이후 모든 메서드 호출에 사용됩니다.

Omnitalk SDK는 싱글톤 패턴으로 제공됩니다. 아래 방법으로 SDK를 초기화시키고 객체를 얻을 수 있습니다.

import 'package:omnitalk_sdk/omnitalk_sdk.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';

Omnitalk.sdkInit(
        serviceId: 'Service ID', serviceKey: 'Service KEY');
Omnitalk sdk = Omnitalk.getInstance();

Last updated