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 기기로 빌드하는 경우에만 필요하다고 생각했습니다.
Felipe

xml 복사 / 붙여 넣기 버전 : D?
Christopher Francisco

20
이 정보가 iOS 빠른 시작에 표시되지 않는 이유는 무엇입니까? developers.facebook.com/quickstarts/926602334080849/…
Paul Brewczynski

1
감사. 어떻게 알아 냈어?
허난 아버

1
@PaulBrewczynski 빠른 시작 안내서에없는 이유는 모르겠지만 다음 문서에서 찾을 수 있습니다. developers.facebook.com/docs/ios/ios9
TMin

25

iOS9를 사용하는 경우 info.plist 파일을 업데이트하는 것이 중요합니다. 3 단계 만 수행하면됩니다. info.plist로 이동하십시오. 2. LSApplicationQueriesSchemes NSArray 데이터 유형 필드를 추가하십시오 . 3. NSString 데이터 유형의 항목을 fbauth2로 추가하십시오.

그게 다야. 청소하고 실행하십시오. 경고가 다시 표시되지 않습니다.여기에 이미지 설명을 입력하십시오


Xcode 7.1에서 이것을 실행하고 있지만 iOS 8.1을 실행하는 iPhone 6 Plus 시뮬레이터를 사용하고 있습니다. 이것이 나타나지 않아야합니까?
Jerome Chan Yeow Heong



5

CFBundleURLSchemes에 이것을 추가하지 마십시오 ... 실제로 Facebook 인증에서 앱의 시도를 HIJACK하여 팝업에 "X app want to open"대화 상자가 표시됩니다.

당신은 그렇게하고 싶지 않습니다.

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

테스트 대상이 기본 번들에 액세스 할 수 없으므로 키위 테스트를 실행할 때 이것을 얻었습니다. 그래서에 조건을 추가해야 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];
}

이것은 나에게도 효과가있었습니다. 다른 일을 할 수 없었습니다. 페이스 북 코드를 편집해야한다는 것이 이상하게 보입니다 .FB가 코코 포드를 업데이트 할 때 지워지지 않습니다.
user2285278

1

iOS 9 용 앱을 빌드하려면 : (Facebook Share)

  1. Info.plistfile을 열고 Information Property List 아래에 LSApplicationQueriesSchemes 필드를 추가 한 후 데이터 유형 또는ArrayNSArray .
  2. LSApplicationQueriesSchemes에 3 개의 항목 을 추가 하고 해당 데이터 유형을 또는StringNSString .
  3. 할당 fbauth2, fbshareextension, fbapi항목 값으로.

이 사진을 따르십시오 :

여기에 이미지 설명을 입력하십시오


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

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.