2016-09-28 13 views
9

私はFacebookにログインしてアプリケーションにログインします。 iOS 10のFacebookを使用してログインしようとしましたが、iPhoneシミュレータ6sです。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. 

私はfacebook 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> 

これらの要件はなかったが含まれている必要がありiOS版のFacebook SDKのv.4.13用https://developers.facebook.com/docs/ios/ios9

2.ホワイトリストのFacebookアプリセクションに対応していることを確認してくださいiOS 9.xについて紹介しました。 facebookで使用されているcantOpenUrlは、引数を使用してurlを呼び出すようにするとき

+0

私はすでにこれを行っていますが、解決されていない問題です。 –

+0

SimulatorにFacebookアプリがインストールされていないので、このエラーはiOSが見つからないことを通知します。この場合、Webベースのログインウィンドウが表示されます。 –

+2

ウェブベースのログインビューを実行するのに役立ちますか?何が起こるか: 私はアプリを実行し、facebookボタンを押します。ウェブベースのビューが開き、このアプリのためにすでにFacebookにログインしていることがわかります。その後、私はOKをクリックし、閉じると、facebookの応答エラー308が表示されます。 ヘルプがありますか? –

11

エラーステータスは基本的に発生しfbauth2:あなたが何かを傾けるよう.ASこのthread BT提案/は、印刷は、この関数内で起こります多くはその

とAppleはあなたが

ターゲット>機能に行くことができます。この問題を解決IOS 10.Toでの作業の方法を変更しました>問題がFBSDLoginManagerであるフォーラムのdevelopor問題

は、この記事に掲載したようここ

を共有Keychainを有効にすると、 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

ちょっと私はあなたの答えを何とか落としてしまったことに気付きました。これは明らかに私の意図ではありませんでした。私はこのことがどのように起こったのか分からず、投票を元に戻そうとしていますが、あなたの答えを編集しない限り、それを行うことは不可能であると警告しています。そうすれば私はそれをアップヴォートするでしょう。ご不便をおかけし、お詫び申し上げます! – i6x86

+0

問題ありません、ありがとう –

1

あなたはCapabilities-でキーチェーンの共有を有効にしていることを確認してください>キーチェーンの共有 appDelegateであなたdidFinishLaunchingWithOptions機能

FBSDKApplicationDelegate.sharedInstance(この行を追加すること

0

てみてくださいを共有キーチェーンを有効にします).application(application、didFinishLaunchingWithOptions:launchOptions)

+0

他の人がそれから学ぶようにあなたの答えを説明できますか? – Robert

関連する問題