yoonjaepark / flutter_naver_login

A Flutter plugin for Naver Sign In.
BSD 2-Clause "Simplified" License
46 stars 69 forks source link

[iOS] 가이드 수정 추가 요청 #67

Closed sehoon787 closed 1 year ago

sehoon787 commented 2 years ago

현재 xcode 10.0 이상 버전 사용시 변경 사항으로 인해 기존 가이드의 AppDelegate.swift의 코드는 잘 적용이 되지 않는 것 같습니다. Swift Compiler Error (Xcode): 'UIApplicationOpenURLOptionsKey' has been renamed to 'UIApplication.OpenURLOptionsKey'

AppDelegate.swift에서 해당 라인을 기존에서 아래와 같이 일부 수정하여 해결 할 수 있었습니다. 제 xcode 및 flutter 관련 버전은 아래와 같습니다.

xcode: 13.4.1, flutter: 3.0.5, Dart: 2.17.6

    override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        var applicationResult = false
        if (!applicationResult) {
           applicationResult = NaverThirdPartyLoginConnection.getSharedInstance().application(app, open: url, options: options)
        }
        // if you use other application url process, please add code here.

        if (!applicationResult) {
           applicationResult = super.application(app, open: url, options: options)
        }
        return applicationResult
    }

https://github.com/yoonjaepark/flutter_naver_login/pull/60 PR에 추가적으로 해당 내용을 추가해두면 https://github.com/yoonjaepark/flutter_naver_login/issues/25 관련 issue가 줄어들 것으로 생각됩니다.

아래는 참고자료입니다. https://stackoverflow.com/questions/51950230/i-opened-my-app-in-xcode-10-and-now-i-have-errors-in-9-4-1-sdkapplicationdeleg https://medium.com/@coolanil.saini/upgrade-your-project-to-support-xcode-10-1-and-swift-4-2-14fcb1daa200

감사합니다.

sehoon787 commented 2 years ago

추가적으로 위와 같은 AppDelegate.swift 수정 사항을 통해 관련 이슈는 해결되었지만, ios에서 네이버 앱을 통해 소셜로그인을 한 뒤, 실행중인 어플리케이션과는 별개로 네이버에서 해당 로그인 메소드를 호출한 어플리케이션을 네이버 앱 위에 다시 실행하는 이슈가 있는 것 같습니다. 치명적이지는 않지만 의도되지 않은 루틴인 것 같아 공유드립니다. 네이버 앱이 없을 때는 물론 해당 현상이 발생하지 않습니다.

gamcho3 commented 1 year ago

혹시 firebase core 와 같이 사용해보셨나요? AppDelegate 파일을 수정하면 firebase와 충돌이 일어나면서 실행이 되지 않습니다.

sehoon787 commented 1 year ago

저는 Google 소셜로그인도 연동하던 상황이라 firebasecore도 함께 사용중이었고 네이버, 애플, 카카오 로그인 모두 구현된 프로젝트였습니다. pr 전 빈 프로젝트에서도 xcode 관련 이슈를 재현했을 때 같은 방식으로 해결되는 것은 확인하였습니다. 혹시 어떤 오류가 나타났는지 알 수 있을까요?

myeongseop-sofit commented 1 year ago

기존 아래 코드를 대체하는걸까요? 빌드가 안되는데요. 흠..

sehoon787 commented 1 year ago

다른 소스를 볼 수 없는 상황이라 어떤 오류인지 잘 짐작이 안됩니다. 아니면 혹시 xcode 버전이 다시 업데이트 되며 기존 수정 방식이 적용되지 않는 경우일 수 있으니 xcode 관련 설정이나 버전을 다시 확인해보시는 것도 좋을 것 같습니다.