Skip to content

Instantly share code, notes, and snippets.

@hariel18
Last active March 8, 2016 10:16
Show Gist options
  • Save hariel18/d3936ec8318d9256ef17 to your computer and use it in GitHub Desktop.
Save hariel18/d3936ec8318d9256ef17 to your computer and use it in GitHub Desktop.
Social App setup in XCode - Facebook - ios
<!-- FACEBOOK -- Info.plist for ios 9-->
<!--
configure FB Application @ developers.facebook.com
and get {your-app-id}
https://developers.facebook.com/docs/ios/getting-started#appid
-->
<!-- Pods -->
pod 'FBSDKCoreKit', '~> 4.10'
pod 'FBSDKLoginKit', '~> 4.10'
<!-- FB APP -->
<key>FacebookAppID</key>
<string>{your-app-id}</string>
<key>FacebookDisplayName</key>
<string>{your-app-name}</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{your-app-id}</string>
</array>
</dict>
</array>
<!-- Whitelist for FB servers (ios9) -->
<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>
<!-- can open app -->
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<!-- Application Delegate -->
// AppDelegate.m
#import <FBSDKCoreKit/FBSDKCoreKit.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
return YES;
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment