Info.plistにiOS 9「fbauth2」がありません


147
FBSDKLog: fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0

これは何ですか?plistに追加しましたが、機能しませんでした。

回答:


347

iOS 9向けにアプリをビルドし、URLスキームを呼び出したい場合は、URLスキームを引き続き使用できます。これで、アプリをInfo.plistで宣言する必要があります。新しいキーであるLSApplicationQueriesSchemesがあり、ここでcanOpenURLにしたいスキームのリストを追加する必要があります。

このようにしてみてください。

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbauth2</string>
</array>

1
ありがとう、若者。私はそれをiOS9デバイスにビルドする場合にのみ必要だと思いました。
フェリペ

xmlコピー/貼り付けバージョンください:D?
クリストファーフランシスコ

20
この情報がiOSのクイックスタートに表示されないのはなぜですか?developers.facebook.com/quickstarts/926602334080849/...
ポールBrewczynski

1
ありがとう。どうやってこれを理解しましたか?
Hernan Arber、2015年

1
:@PaulBrewczynskiそれはクイックスタートガイドではない理由を私は知らないが、私はここにドキュメントでそれを見つけたdevelopers.facebook.com/docs/ios/ios9
TMIN

25

iOS9を使用している場合は、info.plistファイルを更新することが重要です。3つの手順を実行するだけで済みます。1. info.plistに移動します。2 . LSApplicationQueriesSchemes NSArrayデータ型というフィールドを追加します。3. NSStringデータ型の項目を追加し、fbauth2と名前を付けます。

それでおしまい。ちょうどきれいにして実行します。警告は再び表示されません。ここに画像の説明を入力してください


私はこれをXcode 7.1で実行していますが、iOS 8.1を実行しているiPhone 6 Plusシミュレータを使用しています。これは表示されるべきではありませんか?
Jerome Chan Yeow Heong 2015

21

FaceBook SDKのv4.6.0については、次のキーを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


1
developers.facebook.com/docs/ios/getting-startednot、これを行うことをあなたに伝えます、あなたがそれを指摘したのは良いことです!
James111、2016


5

これをCFBundleURLSchemesに追加しないでください... Facebookの認証でアプリの試行が実際にハイジャックされ、ポップアップに「Xアプリが開こうとしています」ダイアログが表示されます...

あなたはそれをしたくありません。

cf:

https://developers.facebook.com/docs/applinks/ios
https://www.fireeye.com/blog/threat-research/2015/04/url_masques_on_apps.html
https://www.reddit.com/r/workflow/comments/2tlx29/get_url_scheme_of_any_app

2

テストターゲットがメインバンドルにアクセスできなかったため、Kiwiテストを実行したときにこれを取得しました。だから私はに条件を追加する必要がありisRegisteredCanOpenURLSchemeましたFBSDKInternalUtility.m

+ (BOOL)isRegisteredCanOpenURLScheme:(NSString *)urlScheme
{
  static dispatch_once_t fetchBundleOnce;
  static NSArray *schemes = nil;

  dispatch_once(&fetchBundleOnce, ^{
    schemes = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"LSApplicationQueriesSchemes"];
    if (!schemes) { // This is a work around for our Kiwi tests as the Specs target doesn't have access to main bundle
      NSBundle *bundle = [NSBundle bundleForClass:[self class]];
      NSString *path = [bundle pathForResource:@"Info" ofType:@"plist"];
      NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path];
      schemes = [dictionary valueForKey:@"LSApplicationQueriesSchemes"];
    }
  });

  return [schemes containsObject:urlScheme];
}

これも私にとってはうまくいきました。他には何も働かなかった。これは、Facebookのコードを編集する必要があるというのは奇妙に思えますが、FBがココポッドを更新したときにコードが消去されません。
user2285278

1

iOS 9用のアプリを作成するには:(Facebook共有の場合)

  1. Info.plistファイルを開き、Information Property Listの下に別のフィールドLSApplicationQueriesSchemesを追加し、 データタイプまたはを設定します。ArrayNSArray
  2. LSApplicationQueriesSchemesに3つの項目を追加し、それらのデータ型をまたはに設定します。StringNSString
  3. 割り当てfbauth2fbshareextensionfbapi項目値として。

この写真をフォロー

ここに画像の説明を入力してください


0
Write the below code in your info.plist under the **LSApplicationQueriesScheme**

<string>fbapi</string>
        <string>fbapi20130214</string>
        <string>fbapi20130410</string>
        <string>fbapi20130702</string>
        <string>fbapi20131010</string>
        <string>fbapi20131219</string>
        <string>fbapi20140410</string>
        <string>fbapi20140116</string>
        <string>fbapi20150313</string>
        <string>fbapi20150629</string>
        <string>fbauth</string>
        <string>fbauth2</string>
        <string>fb-messenger-api20140430</string>
        <string>fb-messenger-platform-20150128</string>
        <string>fb-messenger-platform-20150218</string>
        <string>fb-messenger-platform-20150305</string>

1
時代遅れ。新しいSDKでは必要な数が少なくなります
goodguys_activate 2017

0

以下のコードで試すことができます swift 5.0

extension Bundle {
   static let externalURLSchemes: [String] = {
      guard let urlTypes = main.infoDictionary?["LSApplicationQueriesSchemes"] 
       as? [String] else {
        return []
      }
      return urlTypes
   }()
}

を使用して呼び出すことができます Bundle

guard Bundle.externalURLSchemes.contains(URLScheme) else {
    return
}
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.