{"id":4735,"url":"https://github.com/magus/react-native-facebook-login","last_synced_at":"2026-03-03T18:35:50.198Z","repository":{"id":29429414,"uuid":"32965287","full_name":"magus/react-native-facebook-login","owner":"magus","description":"React Native component wrapping the native Facebook SDK login button and manager","archived":false,"fork":false,"pushed_at":"2019-11-06T11:22:27.000Z","size":64495,"stargazers_count":1239,"open_issues_count":122,"forks_count":325,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-10-24T04:47:02.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-27T03:11:09.000Z","updated_at":"2025-08-27T06:22:25.000Z","dependencies_parsed_at":"2022-08-22T07:51:01.932Z","dependency_job_id":null,"html_url":"https://github.com/magus/react-native-facebook-login","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/magus/react-native-facebook-login","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magus%2Freact-native-facebook-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magus%2Freact-native-facebook-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magus%2Freact-native-facebook-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magus%2Freact-native-facebook-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magus","download_url":"https://codeload.github.com/magus/react-native-facebook-login/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magus%2Freact-native-facebook-login/sbom","scorecard":{"id":612202,"data":{"date":"2025-08-11","repo":{"name":"github.com/magus/react-native-facebook-login","commit":"b4bd29a172216258e151fcae1ac3f4d3939aa70a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":7,"reason":"binaries present in source code","details":["Warn: binary detected: FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit:1","Warn: binary detected: FacebookSDK/FBSDKLoginKit.framework/FBSDKLoginKit:1","Warn: binary detected: FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T02:55:28.371Z","repository_id":29429414,"created_at":"2025-08-21T02:55:28.371Z","updated_at":"2025-08-21T02:55:28.371Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30054691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-01-05T20:17:21.720Z","updated_at":"2026-03-03T18:35:50.179Z","avatar_url":"https://github.com/magus.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["Integrations"],"readme":"# Give [react-native-fbsdk](https://github.com/facebook/react-native-fbsdk) a try!\n\nThis project is no longer maintained. If you would like to maintain it, please reach out with a pull request.\n\n\n# React Native : Facebook SDK Login Button\n\n\u003cdiv\u003e\n    \u003ca href=\"https://www.npmjs.com/package/react-native-facebook-login\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/react-native-facebook-login.svg?style=flat-square\" alt=\"NPM downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/react-native-facebook-login\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/react-native-facebook-login.svg?style=flat\" alt=\"NPM version\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n`\u003cFBLogin /\u003e` provides a [React Native][react-native] component wrapping the native [Facebook SDK login button](https://developers.facebook.com/docs/reference/ios/current/class/FBSDKLoginButton/) and [manager](https://developers.facebook.com/docs/reference/ios/current/class/FBSDKLoginManager/).\n\n\npreview.gif\n\n**Note**: Demo above includes debug text to confirm login (i.e. user name, email and access token). `\u003cFBLogin /\u003e`, by default, will only display the native blue 'Log in with Facebook' button.\n\n## Table of contents\n- [Usage](#usage)\n- [Setup](#setup)\n- [Example project](#example-project)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [Copyright and license](#copyright-and-license)\n\n## Usage\n\n### FBLogin\nProvides a React Native component which wraps the Facebook SDK `FBSDKLoginButton`.\n\n##### Defaults\n```js\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nvar { FBLogin, FBLoginManager } = require('react-native-facebook-login');\n\nclass Login extends Component {\n  render() {\n    return (\n      \u003cFBLogin /\u003e\n    );\n  }\n};\n```\n\n##### Exhaustive\n```js\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nvar { FBLogin, FBLoginManager } = require('react-native-facebook-login');\n\nclass Login extends Component {\n  render() {\n    var _this = this;\n    return (\n      \u003cFBLogin style={{ marginBottom: 10, }}\n        ref={(fbLogin) =\u003e { this.fbLogin = fbLogin }}\n        permissions={[\"email\",\"user_friends\"]}\n        loginBehavior={FBLoginManager.LoginBehaviors.Native}\n        onLogin={function(data){\n          console.log(\"Logged in!\");\n          console.log(data);\n          _this.setState({ user : data.credentials });\n        }}\n        onLogout={function(){\n          console.log(\"Logged out.\");\n          _this.setState({ user : null });\n        }}\n        onLoginFound={function(data){\n          console.log(\"Existing login found.\");\n          console.log(data);\n          _this.setState({ user : data.credentials });\n        }}\n        onLoginNotFound={function(){\n          console.log(\"No user logged in.\");\n          _this.setState({ user : null });\n        }}\n        onError={function(data){\n          console.log(\"ERROR\");\n          console.log(data);\n        }}\n        onCancel={function(){\n          console.log(\"User cancelled.\");\n        }}\n        onPermissionsMissing={function(data){\n          console.log(\"Check permissions!\");\n          console.log(data);\n        }}\n      /\u003e\n    );\n  }\n};\n```\n\n#### Login Behavior\nYou can change the [FBSDK login behavior](https://developers.facebook.com/docs/reference/ios/current/class/FBSDKLoginManager/#FBSDKLoginBehavior%20enum) of the button by including the `loginBehavior` prop on the `FBLogin` component.\n\n- `FBLoginManager.LoginBehaviors.Native`: This is the default behavior, and indicates logging in through the native Facebook app may be used. The SDK may still use Safari instead.\n- `FBLoginManager.LoginBehaviors.Browser`: Attempts log in through the Safari or SFSafariViewController, if available.\n- `FBLoginManager.LoginBehaviors.SystemAccount`: Attempts log in through the Facebook account currently signed in through the device Settings.\n- `FBLoginManager.LoginBehaviors.Web`: Attempts log in through a modal UIWebView pop up.\n\n## FBLoginManager\nWraps features of the native iOS Facebook SDK `FBSDKLoginManager` interface.\n\nSee [example/components/facebook/FBLoginMock.js](example/components/facebook/FBLoginMock.js) for an example using only the exposed native methods of the FBLoginManager to recreate the native `FBSDKLoginButton`.\n\n### Usage\n```js\nvar {FBLoginManager} = require('react-native-facebook-login');\n\nFBLoginManager.setLoginBehavior(FBLoginManager.LoginBehaviors.Web); // defaults to Native\n\nFBLoginManager.loginWithPermissions([\"email\",\"user_friends\"], function(error, data){\n  if (!error) {\n    console.log(\"Login data: \", data);\n  } else {\n    console.log(\"Error: \", error);\n  }\n})\n```\n\n## FBLoginManager.Events\nA variety of events are emitted across the React Native bridge back to your javascript components. This means you can take advantage of the `RCTDeviceEventEmitter.addListener` method to listen, and create subscribers that will execute, for each action. In fact, this is how the onEvent handlers are implemented for the FBLogin component (see [FBLogin.ios.js](FBLogin.ios.js)).\n\n### Usage\n```js\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nvar {FBLoginManager} = require('react-native-facebook-login');\n\n...\n\nvar subscriber = RCTDeviceEventEmitter.addListener(\n  FBLoginManager.Events[\"Login\"],\n  (eventData) =\u003e {\n    console.log(\"[Login] \", eventData);\n  }\n);\n\n...\n\n// Be sure to remove subscribers when they are no longer needed\n// e.g. componentWillUnmount\nsubscriber.remove();\n```\n\n## Setup\n### [Android](/android)\n[Click here for Android setup instructions](/android/README.md)\n\n### iOS\n**Skip this step if you are using RN \u003e= 0.60**\n```sh\nnpm install --save react-native-facebook-login\n```\n- Run ```open node_modules/react-native-facebook-login```\n- Have your react native xcode project open and drag `RCTFBLogin.xcodeproj` into your `Libraries` group.\n- Select your main project in the navigator to bring up settings\n- Under `Build Phases` expand the `Link Binary With Libraries` header\n- Scroll down and click the `+` to add a library\n- Find and add `libRCTFBLogin.a` under the `Workspace` group\n- ⌘+B\n\n**Note**: If your build fails, you most likely forgot to setup the [Facebook SDK](#facebook-sdk)\n\n#### Facebook SDK\n[Facebook : Quick Start for iOS](https://developers.facebook.com/docs/facebook-login/ios)\n\nBe sure to [configure your .plist file](https://developers.facebook.com/docs/ios/getting-started#xcode). This file is located under the `ios/\u003cproject-name\u003e` directory of your generated react-native project. It should be in the same folder as your `AppDelegate.m` file.\n\nAs of iOS 9 you must now explicitly whitelist requests your application makes in the `Info.plist`. Be sure to [follow the instructions for iOS 9](https://developers.facebook.com/docs/ios/ios9) during the setup process.\n\n- Specifically, you will need to add the following to your `Info.plist` file\n\n```xml\n\u003ckey\u003eLSApplicationQueriesSchemes\u003c/key\u003e\n\u003carray\u003e\n        \u003cstring\u003efbapi\u003c/string\u003e\n        \u003cstring\u003efb-messenger-api\u003c/string\u003e\n        \u003cstring\u003efbauth2\u003c/string\u003e\n        \u003cstring\u003efbshareextension\u003c/string\u003e\n\u003c/array\u003e\n```\n\n##### Adding the Facebook SDK (RN \u003c 0.60)\n**SKIP THIS STEP IF YOU ARE USING RN \u003e= 0.60**\n- Run `open node_modules/react-native-facebook-login/FacebookSDK`\n- Open your main project in xcode and right click on your project’s name in the left sidebar and select “New Group” and type in “Frameworks”.\n- Select all the `.framework` files in the FacebookSDK folder and click drag them into the Frameworks folder/group you just created in xcode or highlight the Frameworks group in left sidebar and go to File \u003e Add files to \"yourProjectName\" and select the `.framework` files.\n- Select your main project in the navigator to bring up settings\n- Under `Build Settings` scroll down to `Search Paths`\n- Add the following path to your `Framework Search Paths`\n\n```sh\n$(SRCROOT)/../node_modules/react-native-facebook-login/FacebookSDK\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/magus/react-native-facebook-login/master/images/framework-search-paths.png\" alt=\"framework-search-paths\" /\u003e\n\n##### AppDelegate.m modifications\n- Add the following import statements for FBSDK kits at the top of your `AppDelegate.m`\n\n```objectivec\n#import \u003cFBSDKCoreKit/FBSDKCoreKit.h\u003e\n#import \u003cFBSDKLoginKit/FBSDKLoginKit.h\u003e\n```\n\n- Modify the application didFinishLaunchingWithOptions method to return FBSDKApplicationDelegate instead of `YES`\n\n```objectivec\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n  // ...\n  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n  UIViewController *rootViewController = [[UIViewController alloc] init];\n  rootViewController.view = rootView;\n  self.window.rootViewController = rootViewController;\n  [self.window makeKeyAndVisible];\n  // return YES;\n  return [[FBSDKApplicationDelegate sharedInstance] application:application\n                                    didFinishLaunchingWithOptions:launchOptions];\n}\n```\n\n- Add the following new methods after the application didFinishLaunchingWithOptions method above, before the `@end`.\n\n```objectivec\n// Facebook SDK\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n    [FBSDKAppEvents activateApp];\n}\n\n- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {\n    return [[FBSDKApplicationDelegate sharedInstance] application:application\n                                                          openURL:url\n                                                sourceApplication:sourceApplication\n                                                       annotation:annotation];\n}\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/magus/react-native-facebook-login/master/images/fbsdkapplicationdelegate-methods-example.png\" alt=\"example-fbsdk-frameworks\" /\u003e\n\n## Example project\n### Toy\n```sh\nopen example/ios/examples.xcodeproj\n```\n\nSee the [example](example/) project for a working example.\n\n## Documentation\nTODO\n\n## Contributing\nJust submit a pull request!\n\nUse the simple toy project under the example directory to verify your changes.\n\n```sh\nopen example/toy.xcodeproj\n```\n\n## Contact\n[@magusnn (Twitter)](http://twitter.com/magusnn)\n\n[iamnoah.com](http://iamnoah.com)\n\n## todo\n- Auth with javascript Api as an exposed method on button\n- Clean up duplicate code in login methods\n- documentation for FBLogin component props, expected values (FB SDK links), etc.\n- expose RCT_EXPORT functions on FBLogin, docs as component method, use 'refs' to call - login/logout/getCredentials as methods via FBLogin component ref\n- writePermissions parameter for button\n\n## Copyright and license\n\nCode and documentation copyright 2015 Noah. Code released under [the MIT license](https://github.com/magus/react-native-facebook-login/blob/master/LICENSE).\n\n\n[react-native]: http://facebook.github.io/react-native/\n[fb-sdk-loginbutton]: https://developers.facebook.com/docs/facebook-login/ios/v2.3#login-button\n[fb-sdk-loginmanager]: https://developers.facebook.com/docs/facebook-login/ios/v2.3#login-apicalls\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagus%2Freact-native-facebook-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagus%2Freact-native-facebook-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagus%2Freact-native-facebook-login/lists"}