Facebook iOS SDK 4 info.plist error

I use Facebook-iOS-SDK-4 to login to FB, but when I try to compile, I have this error.

2015-06-05 03: 15: 02.001 Hooiz [4681: 781254] *** Application terminated due to uncaught exception 'InvalidOperationException', reason: 'fb620223481391648 is not registered as a URL scheme. Add it to your Info.plist '

My .plist is similar to the Facebook documentation:

enter image description here

+7
ios facebook sdk swift facebook-ios-sdk
source share
3 answers

Open the info.plist file with a text editor, you should find it like this

 <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string></string> <key>CFBundleURLSchemes</key> <array> <string>fb288500927xxxxx</string> </array> </dict> </array> <key>Item 0</key> <dict> <key>CFBundleURLSchemes</key> <array> <string>fb288500927xxxxxx</string> </array> </dict> <key>CFBundleVersion</key> <string>1</string> <key>FacebookAppID</key> <string>288500927xxxxxx</string> <key>FacebookDisplayName</key> <string>Ψ­Ω…ΩŠΨͺي</string> 

Change it in this format (pay attention to the difference between the two formats), clear the assembly and restart Xcode. and you're done :)

  <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string></string> <key>CFBundleURLSchemes</key> <array> <string>fb288500927xxxxxx</string> </array> </dict> </array> <key>CFBundleVersion</key> <string>1</string> <key>FacebookAppID</key> <string>288500927xxxxxx</string> <key>FacebookDisplayName</key> <string>Ψ­Ω…ΩŠΨͺي</string> 
+7
source share

First, make sure that you followed the Getting Started instructions correctly.

make sure you add this code to your application delegate:

 #import <FBSDKCoreKit/FBSDKCoreKit.h> - (void)applicationDidBecomeActive:(UIApplication *)application { [FBSDKAppEvents activateApp]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; } 

After that, there is another section below the <-> URL types (and here I spent several hours)

make sure that the values ​​in the "URL Schema" field match the value in the URL types β†’ URL Schema in the property list above. (and also match FacebookAppID)

URL types

+3
source share

Check your facebook app id again. Add the registered facebook app id to your info.plist. And also add the URL scheme identifier, fbXXXXXXXXXXXXX (XXXXXXXXX is your facebook application identifier that was added earlier) in info.plist and check

Hope this helps!

-one
source share

All Articles