728x90

해결방법

직접 카카오 sdk의 pod 파일을 열고 수정한다.

  • ASWebAuthenticationSession.init 카카오 로그인시 이 부분에서 앱이 자꾸 크래쉬남
  • SDK버전을 올릴 수 없어서 해결책을 찾아서 해결함

    기존

    let authenticationSession = ASWebAuthenticationSession.init(url: url,
                                                 callbackURLScheme: try! KakaoSDKCommon.shared.redirectUri(),
                                                                                                 completionHandler:authenticationSessionCompletionHandler)

    수정 본

  • let scheme = URL(string: try! KakaoSDKCommon.shared.redirectUri())?.scheme ?? ""
  • 위와같이 스킵 처리를 한다.
if #available(iOS 12.0, *) {
                    let scheme = URL(string: try! KakaoSDKCommon.shared.redirectUri())?.scheme ?? ""
                    let authenticationSession = ASWebAuthenticationSession.init(url: url,
                                                                                 callbackURLScheme: scheme,
                                                                                 completionHandler:authenticationSessionCompletionHandler)
                    if #available(iOS 13.0, *) {
                        authenticationSession.presentationContextProvider = self.presentationContextProvider as? ASWebAuthenticationPresentationContextProviding
                        if agtToken != nil {
                            authenticationSession.prefersEphemeralWebBrowserSession = true
                        }
                    }
                    authenticationSession.start()
                    self.authenticationSession = authenticationSession
                }
복사했습니다!