2016-09-28 3 views
9

내 응용 프로그램에 페이스 북을 사용하여 로그인합니다. iOS 10, iPhone 시뮬레이터 6s에서 Facebook을 사용하여 로그인을 시도합니다.iOS 10의 Facebook 로그인 문제

-canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 

10814 : kLSApplicationNotFoundErr 
-10814 No application in the Launch Services database matches the input criteria. 

페이스 북 SDK 버전 4.13.1을 사용하고 있습니다. Xcode 8 이전에는 동일한 코드가 완벽하게 작동했습니다.

어떤 도움말이 필요합니까? 미리 감사드립니다.

답변

-1

확인하시기 바랍니다 귀하의 의 Info.plist이는

<key>LSApplicationQueriesSchemes</key> 
<array> 
     <string>fbapi</string> 
     <string>fb-messenger-api</string> 
     <string>fbauth2</string> 
     <string>fbshareextension</string> 
</array> 

이러한 요구 사항은 있었다 포함해야 https://developers.facebook.com/docs/ios/ios9 아이폰 OS 페이스 북 SDK의 v.4.13를 들어

2. 화이트리스트 페이스 북 앱 섹션에 해당하는지 확인 iOS 9.x에 대한 소개입니다. facebook에 의해 사용되는 cantOpenUrl이 인수를 사용하여 url를 호출 할 때

+0

이미 완료했지만 문제가 해결되지 않았습니다. –

+0

Simulator에 설치된 Facebook 앱이 없으므로이 오류는 iOS가 찾을 수 없음을 알려줍니다. 이 경우 웹 기반 로그인 창이 표시됩니다. –

+2

웹 기반 로그인보기를 실행하는 데 도움을 줄 수 있습니까? 결과는 다음과 같습니다. 앱을 실행하고 facebook 버튼을 누릅니다. 웹 기반보기가 열리고 이미이 앱의 페이스 북에 로그인했음을 알립니다. 그런 다음 확인을 클릭하고 닫기를 클릭하고 Facebook 응답 오류 308이 표시됩니다. 도움이 필요하십니까? –

11

오류 상태 10,814는 기본적으로 발생 fbauth2 : 당신은 아무것도 할 질수 있도록이 .as이 thread BT는 제안/인쇄이 함수 내에서 발생 그

애플 많은 당신이

대상> 기능에 갈 수이 문제를 해결 IOS 10.To 작업의 방식을 변화 >Keychain에서,이 게시물에 문제가 FBSDLoginManager 함께 포럼의 developor 문제

을 게시 여기

enter image description here

위에 링크 된 동일한 스레드에서 스크린 샷입니다 공유 활성화 완료 핸들을 호출하지 않음

so in debuging, the author put the breakpoint in "FBSDKLoginManager.m" at "logInWithBehavior: (FBSDKLoginBehavior)loginBehavior" and findout that weakSelf getting nil and not be able to call "logInWithBehavior: serverConfiguration: serverConfigurationLoadError:"

- (void)logInWithBehavior:(FBSDKLoginBehavior)loginBehavior 
    { 
     __weak __typeof__(self) weakSelf = self; 
     [FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:^(FBSDKServerConfiguration *serverConfiguration, NSError *loadError) { 
     [weakSelf logInWithBehavior:loginBehavior serverConfiguration:serverConfiguration serverConfigurationLoadError:loadError]; 
     }]; 
    } 

해결 방법 1 :

Change FBSDKLoginManager variable as property rather than using as function variable. Make sure, FBSDKLoginManager variable must remain alive until the completion handler call

당신은 켜 수 -Wimplicit - 유지 - 자기에게 경고를 당신이 블록에서 실수로 자기을 참조하는 경우 경고를받을 수 있습니다.Github issues

솔루션에 배치하는 2 :

당신은 당신의 PLIST에 추가 할 수 있습니다

<key>NSAppTransportSecurity</key> 
    <dict> 
     <key>NSExceptionDomains</key> 
     <dict> 
      <key>akamaihd.net</key> 
      <dict> 
       <key>NSIncludesSubdomains</key> 
       <true/> 
       <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
       <false/> 
      </dict> 
      <key>facebook.com</key> 
      <dict> 
       <key>NSIncludesSubdomains</key> 
       <true/> 
       <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
       <false/> 
      </dict> 
      <key>fbcdn.net</key> 
      <dict> 
       <key>NSIncludesSubdomains</key> 
       <true/> 
       <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
       <false/> 
      </dict> 
     </dict> 
    </dict> 
    <key>LSApplicationQueriesSchemes</key> 
    <array> 
     <string>fbapi</string> 
     <string>fb-messenger-api</string> 
     <string>fbauth2</string> 
     <string>fbshareextension</string> 
    </array> 

에 의해 제안

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
// Override point for customization after application launch. 
    return SDKApplicationDelegate.shared.application(application,  didFinishLaunchingWithOptions: launchOptions) 
} 
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool 
{ 
    return SDKApplicationDelegate.shared.application(app, open: url, options: options) 
} 

을 다음과 같이 또한 AppDelegate에 변경 author이 후에는

는 또한에 의해 언급으로 확인 에 XCode8 당신의 swift3, SDK, ios10를 실행할 수3210 authorGoogle 웹 로그 분석

을 설정하여 뷰 컨트롤러의 상단에 자신의 컨트롤러를 추가하는 경우

Setting "FirebaseAppDelegateProxyEnabled" to "NO" in the -Info.plist solved the problem.

.

Full attribution goes to the forum and the authors mentioned in the forum

+0

이봐, 나는 어떻게 든 당신의 답을 떨어 뜨렸다는 것을 깨달았습니다. 그리고 이것은 분명히 제 의도가 아니 었습니다. 나는 심지어 이런 일이 어떻게되었는지를 알지 못하고 투표를 취소하려고 시도하고 있지만 시스템에서는 답변을 수정하지 않으면 불가능하다고 경고합니다. 그래서 당신이 그것을한다면 나는 그것을 upvote거야. 불편을 드려 죄송합니다. – i6x86

+0

괜찮습니다. 감사합니다. –

1

것은 (당신은 AppDelegate에

FBSDKApplicationDelegate.sharedInstance 당신의 didFinishLaunchingWithOptions 기능을이 줄을 추가

0

시도를 공유 키 체인을 사용 Capabilities-> 키 체인 공유 에서 키 체인 공유를 활성화했는지 확인) .application (application, didFinishLaunchingWithOptions : launchOptions)

+0

다른 사람들이 답변을 얻을 수 있도록 답변을 설명해 주시겠습니까? – Robert