Classes

The following classes are available globally.

  • 카카오 SDK 공통의 환경변수 설정을 위한 클래스입니다.

    싱글톤으로 제공되는 인스턴스를 사용해야 하며 다음과 같이 초기화할 수 있습니다.

    // AppDelegate.swift
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
        KakaoSDKCommon.shared.initSDK(appKey: "<#Your App Key#>")
    
        return true
    }
    

    Important

    SDK 초기화가 수행되지 않으면 SDK 내 모든 기능을 사용할 수 없습니다. 반드시 가장 먼저 실행되어야 합니다.
    See more

    Declaration

    Swift

    public final class KakaoSDKCommon
  • RxSDK의 로그를 담당하는 클래스입니다. logger가 방출하는 로그를 구독하여 화면에 출력하거나 저장된 서버로 전송하여 오류를 수정하는데 활용할 수 있습니다.

    다음은 SDK에서 발생하는 로그를 콘솔 화면에 출력하는 예제입니다.

     // SDK 초기화 시 loggingEnable을 true로 설정
     KakaoSDKCommon.shared.initSDK(appKey: "<#Your App Key#>", loggingEnable: true)
    
     // 로그 구독하기
     RxSdkLog.shared.logger
         .subscribe({ (log) in
             guard let message = log.element as? String else { return }
    
             // 콘솔에 로그 출력하기
             print(message)
    
         })
         .disposed(by: <#Retained DisposeBag() in your lifecycle#>)
    
    See more

    Declaration

    Swift

    public class RxSdkLog : SdkLogBase