{"id":13849080,"url":"https://github.com/lucascorrea/SCFacebook","last_synced_at":"2025-07-12T15:32:56.664Z","repository":{"id":1925600,"uuid":"2853817","full_name":"lucascorrea/SCFacebook","owner":"lucascorrea","description":"The SCFacebook 4.1 is a simple and cleaner to use the api facebook-ios-sdk Objective-C Wrapper (https://github.com/facebook/facebook-ios-sdk) to perform login, get friends list, information about the user and posting on the wall with ^Block for iPhone. Suporte 4.71 FBSDKCoreKit, FBSDKShareKit and FBSDKLoginKit. Facebook SDK","archived":false,"fork":false,"pushed_at":"2018-03-28T16:08:10.000Z","size":6236,"stargazers_count":418,"open_issues_count":1,"forks_count":96,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-06-05T05:16:20.382Z","etag":null,"topics":["block","core","facebook","ios","objective-c","sdk","simple","wrapper"],"latest_commit_sha":null,"homepage":"http://www.lucascorrea.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucascorrea.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-26T02:44:04.000Z","updated_at":"2025-05-25T11:51:37.000Z","dependencies_parsed_at":"2022-08-25T02:21:10.057Z","dependency_job_id":null,"html_url":"https://github.com/lucascorrea/SCFacebook","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lucascorrea/SCFacebook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascorrea%2FSCFacebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascorrea%2FSCFacebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascorrea%2FSCFacebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascorrea%2FSCFacebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucascorrea","download_url":"https://codeload.github.com/lucascorrea/SCFacebook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascorrea%2FSCFacebook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265013551,"owners_count":23698061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["block","core","facebook","ios","objective-c","sdk","simple","wrapper"],"created_at":"2024-08-04T19:01:07.422Z","updated_at":"2025-07-12T15:32:54.811Z","avatar_url":"https://github.com/lucascorrea.png","language":"Objective-C","readme":"\u003c/br\u003e \nThe SCFacebook 4.1 is a simple and cleaner to use the api [Facebook-ios-sdk] (https://github.com/facebook/facebook-ios-sdk) with Blocks.\n\n\nFacebook SDK 4.71 for iOS\n\nGraph API Version v2.12\n\n\tFBSDKCoreKit \n\tFBSDKShareKit\n\tFBSDKLoginKit\n\n\nDemo\n=================\n\n![SCFacebook Demo](http://www.lucascorrea.com/images/SCFacebookDemo.gif)\n\nInstallation\n=================\n\nBefore you need to follow the guide to begin using Facebook SDK for iOS -\n[Getting Started with the Facebook iOS SDK](https://developers.facebook.com/docs/ios/getting-started)\n\n\nGetting Started\n=================\n\nUsing [CocoaPods](http://cocoapods.org) to get start, you can add following line to your Podfile:\n\n\tpod 'SCFacebook'\n\nOnce you have set up the `URL Scheme` and `FacebookAppID` as image below:\n\n![]( http://www.lucascorrea.com/images/FacebookAppID.png))\n\nIOS 9 is required this add fields like the image below:\n\n![]( http://www.lucascorrea.com/images/SCFacebookSettings.png)\n\n\n\nNow in it's `AppDelegate` need to add one method and add permissions\n\n\t  #import \u003cSCFacebook/SCFacebook.h\u003e\n  \n\t  @implementation AppDelegate\n\n\t  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n\n        /**\n        Init SCFacebook\n        Add the necessary permissions\n        \n        If your app asks for more than than public_profile and email, it will require review by Facebook before your app can be used by people other than the app's developers.\n        \n        The time to review your app is usually about 7 business days. Some extra-sensitive permissions, as noted below, can take up to 14 business days.\n        \n        https://developers.facebook.com/docs/facebook-login/permissions/review\n        **/\n        \n        [SCFacebook initWithReadPermissions:@[@\"user_about_me\",\n                                          @\"user_birthday\",\n                                          @\"email\",\n                                          @\"user_photos\",\n                                          @\"user_events\",\n                                          @\"user_friends\",\n                                          @\"user_videos\",\n                                          @\"public_profile\"]\n                     publishPermissions:@[@\"manage_pages\",\n                                          @\"publish_actions\",\n                                          @\"publish_pages\"]\n        ];\n    \n        [FBSDKProfile enableUpdatesOnAccessTokenChange:YES];\n        return [[FBSDKApplicationDelegate sharedInstance] application:application\n                                        didFinishLaunchingWithOptions:launchOptions];\n  }\n \n\n\t#pragma mark - \n\t#pragma mark - SCFacebook Handle\n\t      \n\t- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {\n\t          return [[FBSDKApplicationDelegate sharedInstance] application:application\n\t                                                              openURL:url\n\t                                                    sourceApplication:sourceApplication\n\t                                                           annotation:annotation];\n\t}\n\t  \nExample Usage\n=============\n\nTo use the component is very easy. Import the header for your class.\n\n\t  #import \u003cSCFacebook/SCFacebook.h\u003e\n  \n\t  @implementation ViewController\n\n\t  #pragma mark - Button Action\n\t  - (IBAction)login:(id)sender {\n      \n\t    [SCFacebook loginCallBack:^(BOOL success, id result) {\n\t            if (success) {\n\t            }\n\t     }];\n\t  }\n\n    - (IBAction)publishYourWallLink:(id)sender {\n      [SCFacebook feedPostWithLinkPath:@\"http://www.lucascorrea.com\" caption:@\"Portfolio\" callBack:^(BOOL success, id result) {\n                if (success) {\n              }\n      }];\n    }\n\n    - (IBAction)publishYourWallMessage:(id)sender {\n      [SCFacebook feedPostWithMessage:@\"This is message\" callBack:^(BOOL success, id result) {\n          if (success) {\n              }\n      }];\n    }\n\n\nMethods\n===========\n\n\nWhen a person logs into your app via Facebook Login you can access a subset of that person's data stored on Facebook. Permissions are how you ask someone if you can access that data. A person's privacy settings combined with what you ask for will determine what you can access.\nPermissions are strings that are passed along with a login request or an API call. Here are two examples of permissions:\nemail - Access to a person's primary email address.\nuser_likes - Access to the list of things a person likes.\nhttps://developers.facebook.com/docs/facebook-login/permissions/v2.4\n@param permissions\n\n    + (void)initWithReadPermissions:(NSArray *)readPermissions publishPermissions:(NSArray *)publishPermissions;\n\n\nChecks if there is an open session, if it is not checked if a token is created and returned there to validate session.\n@return BOOL\n\n    + (BOOL)isSessionValid;\n\n\nFacebook login\nhttps://developers.facebook.com/docs/ios/graph\n@param callBack (BOOL success, id result)\n\n    + (void)loginCallBack:(SCFacebookCallback)callBack;\n\n\nFacebook login\nhttps://developers.facebook.com/docs/ios/graph\n@param FBSDKLoginBehavior behavior\n@param callBack (BOOL success, id result)\n\n    + (void)loginWithBehavior:(FBSDKLoginBehavior)behavior CallBack:(SCFacebookCallback)callBack;\n\nFacebook logout\nhttps://developers.facebook.com/docs/ios/graph\n@param callBack (BOOL success, id result)\n\n    + (void)logoutCallBack:(SCFacebookCallback)callBack;\n\n\nGet the data from the logged in user by passing the fields.\nhttps://developers.facebook.com/docs/facebook-login/permissions/v2.12#reference-public_profile\nPermissions required: public_profile...\n@param callBack (BOOL success, id result)\n\n    + (void)getUserFields:(NSString *)fields callBack:(SCFacebookCallback)callBack;\n\n\nThis will only return any friends who have used (via Facebook Login) the app making the request.\nIf a friend of the person declines the user_friends permission, that friend will not show up in the friend list for this person.\n1 - get the User's friends who have installed the app making the query\n2 - get the User's total number of friends (including those who have not installed the app making the query)\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/friends/\nPermissions required: user_friends\n@param fields   fields example: id, name, email, birthday, about, picture\n@param callBack (BOOL success, id result)\n\n    + (void)getUserFriendsWithFields:(NSString *)fields callBack:(SCFacebookCallback)callBack;\n\n\nThis will only return any friends who have used (via Facebook Login) the app making the request.\nIf a friend of the person declines the user_friends permission, that friend will not show up in the friend list for this person.\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/friends/\nPermissions required: user_friends\n@param callBack (BOOL success, id result)\n\n    + (void)getUserFriendsCallBack:(SCFacebookCallback)callBack __attribute__ ((deprecated(\"getUserFriendsCallBack has been replaced with getUserFriendsWithFields:callBack\")));\n\n\nPost in the user profile with link and caption\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/feed\nPermissions required: publish_actions\n@param url      NSString\n@param caption  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostWithLinkPath:(NSString *)url caption:(NSString *)caption callBack:(SCFacebookCallback)callBack;\n\n\nPost in the user profile with message\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/feed\nPermissions required: publish_actions\n@param message  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostWithMessage:(NSString *)message callBack:(SCFacebookCallback)callBack;\n\n\nPost in the user profile with photo and caption\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/feed\nPermissions required: publish_actions\n@param photo    UIImage\n@param caption  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostWithPhoto:(UIImage *)photo caption:(NSString *)caption callBack:(SCFacebookCallback)callBack;\n\n\nPost in the user profile with video, title and description\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/feed\nPermissions required: publish_actions\n@param videoData   NSData\n@param title       NSString\n@param description NSString\n@param callBack    (BOOL success, id result)\n\n    + (void)feedPostWithVideo:(NSData *)videoData title:(NSString *)title description:(NSString *)description callBack:(SCFacebookCallback)callBack;\n\n\nThe feed of posts (including status updates) and links published by this person, or by others on this person's profile.\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/feed\nPermissions required: read_stream\n@param callBack (BOOL success, id result)\n\n    + (void)myFeedCallBack:(SCFacebookCallback)callBack;\n\n\nInvite friends with message via dialog\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/\n@param appLink URL\n@param preview URL optional\n@param callBack (BOOL success, id result)\n\n    + (void)inviteFriendsWithAppLinkURL:(NSURL *)url previewImageURL:(NSURL *)preview callBack:(SCFacebookCallback)callBack __attribute__ ((deprecated(\"App Invites no longer supported\")));\n\nGet pages in user\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: manage_pages\n@param callBack (BOOL success, id result)\n\n    + (void)getPagesCallBack:(SCFacebookCallback)callBack;\n\n\nGet page with id\nFacebook Web address ou pageId\nExample http://www.lucascorrea.com/PageId.png\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: manage_pages\n@param pageId   Facebook Web address ou pageId\n@param callBack (BOOL success, id result)\n\n    + (void)getPageById:(NSString *)pageId callBack:(SCFacebookCallback)callBack;\n\n\nPost in the page profile with message\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page     NSString\n@param message  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostForPage:(NSString *)page message:(NSString *)message callBack:(SCFacebookCallback)callBack;\n\nPost in the page profile with message and photo\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page     NSString\n@param message  NSString\n@param photo    UIImage\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostForPage:(NSString *)page message:(NSString *)message photo:(UIImage *)photo callBack:(SCFacebookCallback)callBack;\n\nPost in the page profile with message and link\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page     NSString\n@param message  NSString\n@param url      NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostForPage:(NSString *)page message:(NSString *)message link:(NSString *)url callBack:(SCFacebookCallback)callBack;\n\nPost in the page profile with video, title and description\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page        NSString\n@param videoData   NSData\n@param title       NSString\n@param description NSString\n@param callBack    (BOOL success, id result)\n\n    + (void)feedPostForPage:(NSString *)page video:(NSData *)videoData title:(NSString *)title description:(NSString *)description callBack:(SCFacebookCallback)callBack;\n\nPost on page with administrator profile with a message\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page     NSString\n@param message  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostAdminForPageName:(NSString *)page message:(NSString *)message callBack:(SCFacebookCallback)callBack;\n\nPost on page with administrator profile with a message and link\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page     NSString\n@param message  NSString\n@param url      NSString\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostAdminForPageName:(NSString *)page message:(NSString *)message link:(NSString *)url callBack:(SCFacebookCallback)callBack;\n\nPost on page with administrator profile with a message and photo\nPermissions required: publish_actions\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\n@param page     NSString\n@param message  NSString\n@param photo    UIImage\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostAdminForPageName:(NSString *)page message:(NSString *)message photo:(UIImage *)photo callBack:(SCFacebookCallback)callBack;\n\nPost on page with administrator profile with a video, title and description\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/page\nPermissions required: publish_actions\n@param page        NSString\n@param videoData   NSData\n@param title       NSString\n@param description NSString\n@param callBack    (BOOL success, id result)\n\n    + (void)feedPostAdminForPageName:(NSString *)page video:(NSData *)videoData title:(NSString *)title description:(NSString *)description callBack:(SCFacebookCallback)callBack;\n\nGet albums in user\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/albums\nPermissions required: user_photos\n@param callBack (BOOL success, id result)\n\n    + (void)getAlbumsCallBack:(SCFacebookCallback)callBack;\n\nGet album with id\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/albums\nPermissions required: user_photos\n@param albumId  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)getAlbumById:(NSString *)albumId callBack:(SCFacebookCallback)callBack;\n\nGet photos the album with id\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/album/photos\nPermissions required: user_photos\n@param albumId  NSString\n@param params   NSDictionary ex: @{@\"fields\": @\"name, images\"}\n@param callBack (BOOL success, id result)\n\n    + (void)getPhotosAlbumById:(NSString *)albumId withParams:(NSDictionary*)params callBack:(SCFacebookCallback)callBack;\n\nGet photos the album with id\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/album/photos\nPermissions required: user_photos\n@param albumId  NSString\n@param callBack (BOOL success, id result)\n\n    + (void)getPhotosAlbumById:(NSString *)albumId callBack:(SCFacebookCallback)callBack __attribute__ ((deprecated(\"getPhotosAlbumById:callBack has been replaced with getPhotosAlbumById:withParams:callBack\")));\n\nCreate album the user\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/user/albums\nPermissions required: publish_actions and user_photos\n@param name     NSString\n@param message  NSString\n@param privacy  ENUM\n@param callBack (BOOL success, id result)\n\n    + (void)createAlbumName:(NSString *)name message:(NSString *)message privacy:(FBAlbumPrivacyType)privacy callBack:(SCFacebookCallback)callBack;\n\nPost the photo album in your user profile\nhttps://developers.facebook.com/docs/graph-api/reference/v2.12/album/photos\nPermissions required: publish_actions\n@param albumId  NSString\n@param photo    UIImage\n@param callBack (BOOL success, id result)\n\n    + (void)feedPostForAlbumId:(NSString *)albumId photo:(UIImage *)photo callBack:(SCFacebookCallback)callBack;\n\nPost open graph\nOpen Graph lets apps tell stories on Facebook through a structured, strongly typed API. When people engage with these stories they are directed to your app or, if they don't have your app installed, to your app's App Store page, driving engagement and distribution for your app.\nStories have the following core components:\nAn actor: the person who publishes the story, the user.\nAn action the actor performs, for example: cook, run or read.\nAn object on which the action is performed: cook a meal, run a race, read a book.\nAn app: the app from which the story is posted, which is featured alongside the story.\nWe provide some built in objects and actions for frequent use cases, and you can also create custom actions and objects to fit your app.\nhttps://developers.facebook.com/docs/ios/open-graph\nPermissions required: publish_actions\n@param actionType       NSString\n@param graphObject      NSString\n@param objectName       NSString\n@param viewController   UIViewController\n@param callBack        (BOOL success, id result)\n\n    + (void)sendForPostOpenGraphWithActionType:(NSString *)actionType graphObject:(FBSDKShareOpenGraphObject *)openGraphObject objectName:(NSString *)objectName viewController:(UIViewController *)viewController callBack:(SCFacebookCallback)callBack;\n\nIf not on the list in SCFacebook method, this method can be used to make calls via the graph API GET\nCalling the Graph API GET\nhttps://developers.facebook.com/docs/ios/graph\n@param method   NSString\n@param params   NSDictionary\n@param callBack (BOOL success, id result)\n\n    + (void)graphFacebookForMethodGET:(NSString *)method params:(id)params callBack:(SCFacebookCallback)callBack;\n\nIf not on the list in SCFacebook method, this method can be used to make calls via the graph API POST\nCalling the Graph API POST\nhttps://developers.facebook.com/docs/ios/graph\n@param method   NSString\n@param params   NSDictionary\n@param callBack (BOOL success, id result)\n\n    + (void)graphFacebookForMethodPOST:(NSString *)method params:(id)params callBack:(SCFacebookCallback)callBack;\n\n\nLicense\n=============\n\nSCFacebook is licensed under the MIT License:\n\nCopyright (c) 2011-present Lucas Correa (http://www.lucascorrea.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucascorrea%2FSCFacebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucascorrea%2FSCFacebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucascorrea%2FSCFacebook/lists"}