Facebook SDK: app not registered as a URL Scheme

后端 未结 10 1093
無奈伤痛
無奈伤痛 2020-11-30 22:41

I am using the Facebook SDK found here, and am trying the sample that is provided (in the folder FacebookiOSSample).

If I simply replace th

相关标签:
10条回答
  • 2020-11-30 23:07

    I don't know if your problem is the same as mine. But it took me some time to find it and i will put it here so that it can help anyone.. The problem was that google sign in used the same info.plist attribute name and it was overriding the ones of facebook.. So i could see this in X-Code and put them together, now everything works fine! (URL Types attribute).

    0 讨论(0)
  • 2020-11-30 23:08

    there is another section below the info - URL Types

    check that the values there, under the URL Schemes field match the value in the URL types -> URL Schemes in the property list above. (and also match the FacebookAppID)

    URL TYPES

    0 讨论(0)
  • 2020-11-30 23:10

    1- In Xcode, right-click your project's Info.plist file and select Open As -> Source Code.

    2- Insert the following XML snippet into the body of your file just before the final </dict> element.

      <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>fb{your-app-id}</string>
        </array>
      </dict>
    </array>
    <key>FacebookAppID</key>
    <string>{your-app-id}</string>
    <key>FacebookDisplayName</key>
    <string>{your-app-name}</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>fbapi</string>
      <string>fb-messenger-share-api</string>
      <string>fbauth2</string>
      <string>fbshareextension</string>
    </array>
    

    3- Replace {your-app-id}, and {your-app-name} with your app's App's ID and name found on the Facebook App Dashboard.

    0 讨论(0)
  • 2020-11-30 23:12

    Go to this Link Select Your App, And configure your info.plist

    0 讨论(0)
  • 2020-11-30 23:18

    In terms of raw keys and values you should have CFBundleURLTypes and CFBundleURLSchemes

    In terms of raw keys and values you should have CFBundleURLTypes and CFBundleURLSchemes. Hope that helps!

    0 讨论(0)
  • 2020-11-30 23:18

    For iOS 9

    If you have an error: 'LSApplicationQueriesSchemes'

    Based on Bear with me answer, you will also have to add those lines:

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

    See this.

    You should end up with those lines at the end of your .plist files:

    <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>fb2R3234544534554</string>
                </array>
            </dict>
        </array>
        <key>FacebookAppID</key>
        <string>2R3234544534554</string>
        <key>FacebookDisplayName</key>
        <string>stevejeff</string>
        <key>NSAppTransportSecurity</key>
        <dict>
            <key>NSExceptionDomains</key>
            <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>
                <key>akamaihd.net</key>
                <dict>
                    <key>NSIncludesSubdomains</key>
                    <true/>
                    <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                    <false/>
                </dict>
            </dict>
        </dict>
        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>fbauth2</string>
        </array>
        </dict>
        </plist>
    

    * If you're using v4.6.0 or higher of the SDK, you only need to add:* (Thanks mohsinj)

       <key>LSApplicationQueriesSchemes</key>
          <array>
            <string>fbapi</string>
            <string>fb-messenger-api</string>
            <string>fbauth2</string>
            <string>fbshareextension</string>
       </array>
    
    0 讨论(0)
提交回复
热议问题