programing

Info.plist에 iOS 9 "fbauth2"가 없습니다.

iphone6s 2023. 4. 17. 21:33
반응형

Info.plist에 iOS 9 "fbauth2"가 없습니다.

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

이게 뭔지 알아?나는 그것을 내 목록에 추가했지만 작동하지 않았다.

iOS 9용 앱을 만들고 URL 스킴을 호출하려면 앱 Info.plist에서 URL 스킴을 선언해야 합니다.LSApplicationQueriesScemes라는 새로운 키가 있습니다.여기서 canOpen으로 할 스킴 목록을 추가해야 합니다.URL on.

이렇게 해봐.

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

iOS9를 사용하는 경우 info.plist 파일을 업데이트하는 것이 중요합니다.3단계 1만 하면 돼요.info.plist 2로 이동합니다.필드(LSApplicationQueriesScemes NSArray 데이터 유형)를 추가합니다.3. NSString 데이터 유형의 항목을 fbauth2로 추가합니다.

바로 그거야.청소만 하고 도망가면 돼 경고는 다시 안 여기에 이미지 설명 입력뜨니까

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

Facebook 설명: iOS9용준비하기
Apple은 다음과 같이 말하고 있습니다.개인 정보 보호 및 앱 키노트 2015

이것을 CFBundle에 추가하지 말아 주세요.URLChemes...실제로 앱이 Facebook 인증을 시도하면 "X app wants 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

테스트 대상이 메인 번들에 접근할 수 없었기 때문에 키위 테스트를 실행할 때 받았습니다.그래서 조건을 붙여야 했어요.isRegisteredCanOpenURLSchemeFBSDKInternalUtility.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];
}

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

  1. 열다.Info.plist파일, 정보 속성 목록에 다른 필드 LSApplicationQueriesScemes를 추가하고 해당 데이터 유형을 설정합니다.Array또는NSArray.
  2. LSApplicationQueriesScemes3개의 항목을 추가하고 데이터 유형을 다음과 같이 설정합니다.String또는NSString.
  3. 할당fbauth2,fbshareextension,fbapi아이템값으로 지정합니다.

다음 사진을 팔로우 합니다.

여기에 이미지 설명 입력

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>

아래 코드를 사용하여 시도할 수 있습니다.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
}

언급URL : https://stackoverflow.com/questions/32006033/ios-9-fbauth2-missing-from-info-plist

반응형