4

I don't know whats wrong, I installed FacebookSDK using Cocoapods (as always), and I am getting an error in this method:

    _dispatch_once(dispatch_once_t *predicate, dispatch_block_t block)
{
  if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) {
    dispatch_once(predicate, block);
  }
}

The red line of the error is on the line dispatch_once (predicate, block); . I am not doing anything different than other times using FacebookSDK.

Can anyone help?

3 Answers3

3

Configure your info.plist (find it in the Supporting Files folder in your Xcode Project).

  1. Right-click your .plist file and choose "Open As Source Code".

  2. Copy & Paste the XML snippet into the body of your file (inside of the <dict>...</dict>):

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>FB + AP-ID</string>
    </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string> AP-ID </string>
<key>FacebookDisplayName</key>
<string>App-Name</string>
  1. If you use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, your application's .plist also need to handle this.
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fb-messenger-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
</array>

Source: Facebook SDK Documentation

Robin Daugherty
  • 7,115
  • 4
  • 45
  • 59
0

My app kept crashing and producing the error message:

'The service configuration is `nil`

on the same line:

dispatch_once(predicate, block);

while trying to implement AWS Auth via the Mobile Hub into my iOS app.

I spent a lot of hours editing my info.plist, googling solutions, and re-downloading the awsconfiguration.json file only to discover that my "Target Membership" box in the right side bar of Xcode was unchecked. Once I checked it my app successfully built with AWS Auth working fine.

Hope this helps someone.

tameikal
  • 166
  • 1
  • 6
  • sorry, where is that target membership box? I think I'm having same problem – alionthego Feb 03 '18 at 05:07
  • 1
    under the Project Navigator click on your awsconfiguration.json file. if you have the right sidebar open there will be Target Membership for your "App Name". Check the box if it is unchecked so. I think this makes the file config file point to your app so they can communicate. – tameikal Feb 05 '18 at 16:46
0

So I had the same issue, and fixed it by reinstalling all of my pod files by removing from Podfile, running "pod update" and then readding them and running "pod update" again. Worked like a charm.