Reactive

extension Reactive where Base: AuthApi
extension Reactive where Base: AuthController
  • 사용자 인증코드를 이용하여 신규 토큰 발급을 요청합니다.

    Declaration

    Swift

    public func token(code: String,
                      codeVerifier: String? = nil,
                      redirectUri: String = KakaoSDK.shared.redirectUri()) -> Single<OAuthToken>
  • 기존 토큰을 갱신합니다.

    Declaration

    Swift

    public func refreshToken(token oldToken: OAuthToken? = nil) -> Single<OAuthToken>
  • 카카오톡 간편로그인 등 외부로부터 리다이렉트 된 코드요청 결과를 처리합니다. AppDelegate의 openURL 메소드 내에 다음과 같이 구현해야 합니다.

    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        if (AuthController.isKakaoTalkLoginUrl(url)) {
            if AuthController.rx.handleOpenUrl(url: url, options: options) {
                return true
            }
        }
    
        // 서비스의 나머지 URL 핸들링 처리
    }
    

    Declaration

    Swift

    public static func handleOpenUrl(url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool
  • 사용자 인증코드를 이용하여 신규 토큰 발급을 요청합니다.

    Declaration

    Swift

    public func certToken(code: String,
                          codeVerifier: String? = nil,
                          redirectUri: String = KakaoSDK.shared.redirectUri()) -> Single<CertTokenInfo>