Last active
December 16, 2015 10:19
-
-
Save mingder78/5419003 to your computer and use it in GitHub Desktop.
facebook for iOS using Cocoapod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0. install cocoapod, refer to URL: http://cocoapods.org/ | |
| 1. create a new iOS xcode project. | |
| 2. create a Pofile (filename is Podfile) in that project home directory with following content. | |
| platform :ios, "5.0" | |
| pod do |s| | |
| s.name = 'Facebook-iOS-SDK' | |
| s.version = '3.5.0' | |
| s.platform = :ios | |
| s.license = 'Apache License, Version 2.0' | |
| s.summary = 'The iOS SDK provides Facebook Platform support for iOS apps.' | |
| s.description = 'The Facebook SDK for iOS enables you to access the Facebook Platform APIs including the Graph API, FQL, and Dialogs.' | |
| s.homepage = 'http://developers.facebook.com/docs/reference/iossdk' | |
| s.author = 'Facebook' | |
| s.source = { :git => 'https://github.com/facebook/facebook-ios-sdk.git', :tag => 'sdk-version-3.5.0' } | |
| s.source_files = 'src/*.{h,m}', 'src/Base64/*.{h,m}', 'src/Cryptography/*.{h,m}' | |
| s.resources = 'src/FacebookSDKResources.bundle', 'src/FBUserSettingsViewResources.bundle' | |
| s.library = 'sqlite3.0' | |
| s.header_dir = 'FacebookSDK' | |
| s.weak_frameworks = 'Accounts', 'AdSupport', 'Social', 'Security' | |
| s.framework = 'CoreLocation' | |
| end | |
| 3. type "pod install" | |
| 4. start your xcode project with "open your-app..xcworkspace" | |
| 5. add FacebookAppID to your-app-Info.plist, refer to URL:https://fbcdn-dragon-a.akamaihd.net/cfs-ak-ash4/78462/591/144727299041230-/plist_matching_disp_name.png | |
| edit app-Info.plist with source code as follows will faster. | |
| <key>CFBundleURLTypes</key> | |
| <array> | |
| <dict> | |
| <key>CFBundleURLSchemes</key> | |
| <array> | |
| <string>fb1285724439573xx</string> | |
| </array> | |
| </dict> | |
| </array> | |
| <key>FacebookAppID</key> | |
| <string>1285724439573xx</string> | |
| 6. modify code as in URL: https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/ | |
| 7. build and run it. | |
| Good coding! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment