GithubHelp home page GithubHelp logo

facebookarchive / react-native-fbsdk Goto Github PK

View Code? Open in Web Editor NEW
3.0K 3.0K 910.0 3.02 MB

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.

Home Page: https://developers.facebook.com/docs/react-native

License: Other

JavaScript 27.87% Objective-C 30.89% Java 39.80% Ruby 0.59% Starlark 0.79% C 0.04% Swift 0.02%

react-native-fbsdk's Introduction

React Native FBSDK

Facebook has ended official support for our React Native wrapper around the Facebook SDKs for Android and iOS. We are pleased by the community's efforts that make the Facebook SDK for React Native a success. We believe the community is well equipped to address developer needs going forward. Note that our support for React Native continues and is not affected by this.

The current version of the project will move to Facebook Archive. We recommend the community fork this repo into a new project that can be continuously maintained by the community. We encourage the community to make any necessary changes that they believe will enhance the functionality of the SDK moving forward.

Existing fork as an alternative - https://www.npmjs.com/package/react-native-fbsdk-next

react-native-fbsdk's People

Contributors

andrewjack avatar arv avatar dabit3 avatar daxserver avatar dreamolight avatar dzhuowen avatar friederbluemle avatar grabbou avatar hramos avatar ishigamii avatar janicduplessis avatar joesus avatar justinmakaila avatar knowbody avatar koenpunt avatar leggomyfroggo avatar lepouya avatar philikon avatar philippkrone avatar ralfnieuwenhuizen avatar ramirobg94 avatar redcancode avatar reidab avatar robteix avatar sdduursma avatar sooheesh avatar ssuchanowski avatar syaau avatar titozzz avatar vovkasm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-fbsdk's Issues

Undefined symbols for architecture x86_64

I get the following error: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from: objc-class-ref in AppDelegate.o when running the app to use the Login Button.

package.json dependencies

    "react-native": "git://github.com/facebook/react-native.git#master",
    "react-native-fbsdkcore": "0.0.5",
    "react-native-fbsdklogin": "0.0.5",

AppDelegate.m

#import "AppDelegate.h"

#import "RCTRootView.h"

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=false"];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"Divebook"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [[UIViewController alloc] init];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  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
  ];
}


@end

RCTAlertManager.alertWithArgs must not be null

Hi,

Having this error trying to use the login button on react native 0.10.
[error][tid:main][RCTModuleMethod.m:59] Argument 1 (RCTResponseSenderBlock) of RCTAlertManager.alertWithArgs must not be null.
Any idea how this could be fixed ?

Thanks for the help

Podfile instructions outdated

When creating a new project, the node_modules directory is not on the folder as the podfile.

This should work:

pod 'React', :subspecs => ['Core', 'RCTImage', 'RCTNetwork', 'RCTText', 'RCTWebSocket'], :path => '../node_modules/react-native'
pod 'react-native-fbsdkcore', :path => '../node_modules/react-native-fbsdkcore'
pod 'react-native-fbsdklogin', :path => '../node_modules/react-native-fbsdklogin'
pod 'react-native-fbsdkshare', :path => '../node_modules/react-native-fbsdkshare'

Sample App: FBSDKShareKit.h file not found.

I just cloned the repo. Did npm install. I get below error when i try to run the sample app.

Sample/node_modules/react-native-fbsdkshare/iOS/RCTFBSDKShareDialog.h:21:9: 'FBSDKShareKit/FBSDKShareKit.h' file not found

I can see shareKit framework being linked in the Sample app. Not sure what else i can do to debug this.

Login with native dialog

I notice that apps like Tinder have native login dialog, i.e. they don't open a web view for logging in. I am trying to achieve the same thing with React Native FBSDKLoginButton, and try to set the loginBehavior prop to native, but it seems no matter what the value is, a web view pops up. Is this a missing feature of react-native-fbsdklogin or a misconfig from my part?

Facebook-login not displaying the button

Hi,

I know the plugin is very new, but I already got a problem (it's most likely on me).
Everything compiles, but I got this:

image

I got this when just trying to set the Login button on the page, with that example code from the npm:

        return (
            <View style={styles.container}>
                <FBSDKLoginButton
                    onLoginFinished={(error, result) => {
                        if (error) {
                            alert('Error logging in.');
                        } else {
                            if (result.isCanceled) {
                                alert('Login cancelled.');
                            } else {
                                alert('Logged in.');
                            }
                        }
                    }}
                    onLogoutFinished={() => alert('Logged out.')}
                    readPermissions={[]}
                    publishPermissions={['publish_actions']}
                />
            </View>
        );

I'd like to detail that I got the plist right since I got another facebook-login to work, and I'm just using the frameworks from Documents/FacebookSDK instead. So this should be right.

I believe the mistake could come from my AppDelegate since I modified it several times to install different plugins and I don't understand (at all) what's in it:


#import "AppDelegate.h"

#import "RCTRootView.h"

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"JibberJabber"
                                                   launchOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [[UIViewController alloc] init];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;
}



// ----------------------------- Facebook login -------------------------------

// Facebook SDK
- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                        openURL:url
                                              sourceApplication:sourceApplication
                                                     annotation:annotation];
}

// -------------------------------------------------------------------------------------------------
// Code part required for the orientation control (react-native-orientation)
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
  NSUInteger orientations;

  orientations = UIInterfaceOrientationMaskPortrait;

  if (self.shouldRotate == YES) {
    orientations = UIInterfaceOrientationMaskAllButUpsideDown;
  }

  return orientations;
}

@end

Can anyone help me out?

Login works ONCE only.

Everything works the first time, but then all subsequent attempts come back with isCancelled as true. I have to remove my app entirely from the Simulator and reinstall it before it will work again. Same on my actual phone.

Anyone else seeing this? Any ideas how to fix? Thanks

Pod install falied

[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `pods_project' for #Pod::Hooks::InstallerRepresentation:0x007fcb1c22cc68

execute pod install in Sample folder.

Detailed Share API?

I have run examples provided in readme.md but I was wondering if there's any place I could take a look at detailed Share API

Can't Archive App - "RCTBridgeModule.h' not found

Hi, firstly thank you for these libraries. They are a great help :) .

Sorry to flag issues but I have installed them and got them all running fine. But for some reason, when I try to archive my app for testflight I get an error

Line 19 of RCTFBSDKShareDialog.h

Lexical or Preprocessor Issue
'RCTBridgeModule.h' file not found

Do you know what could be causing this?

version Info:
react-native v0.9
xcode v6.3.2
OSX 10.10.4

App crashes when clicking on the top left corner "Back to <App>" in AppInviteDialog

Hello,

I'm using the FBSDKAppInviteContent as follows:

  var inviteContent = new FBSDKAppInviteContent('https://fb.me/XXXXXXXXXXXX', 'my.png');
  FBSDKAppInviteDialog.show(inviteContent, (error, result) => {
    console.log(error);
    console.log(result);
  });

That works quite fine except the case that the user clicks on "Back to app" at the top left corner of the device screen in the facebook app:

  1. Click on button to trigger the AppInviteDialog
  2. Don't click "Cancel" but click on "Back to "

Any idea what this might cause?

Regards
Philipp

Update 1:
It seems like the following code in RCTFBSDKAppInviteDialog.m throws an exception:

  if ([results[@"completionGesture"] isEqualToString:@"cancel"]) {
    _showCallback(@[[NSNull null], @{@"isCancelled": @YES}]);
  } else {
    _showCallback(@[[NSNull null], results]);
  }
  _showCallback = nil;

as "results" in the else {} block is NULL, the following exception is thrown:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1]'
*** First throw call stack:

Update 2
Changing the lines to the following seems to work:

  if ([results[@"completionGesture"] isEqualToString:@"cancel"]) {
    _showCallback(@[[NSNull null], @{@"isCancelled": @YES}]);
  } else {
    if (results == NULL) {
        _showCallback(@[[NSNull null], [NSNull null]]);
    } else {
        _showCallback(@[[NSNull null], results]);
    }

If this is the correct way to fix it, I'll gladly submit a PR.

I keep seeing the confirm page at every login click

screen shot 2015-09-07 at 5 26 52 pm

The user already granted permissions. However, every time the users logs out and logs in again, that screen is shown. Unless the app is asking for more permission or it is first time usage, the Confirm screen shouldn't appear.

Any suggestion to skip the Confirm screen after user grants access?
Thanks!

SIGABRT when pressing on the log in button

Hi,

I've encountered a new issue: when pressing the login button, the app freezes and XCode returns a SIGABRT error in main.m, highlighting the return line of it:

int main(int argc, char * argv[]) {
  @autoreleasepool {
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
  }
}

For info, I successfully logged out just before.
Does anyone know why that? And what could help?

FBSDKLoginButton not refresh itself

I have a FBSDKLoginButton in my login view, and I use FBSDKLoginManager in another view. When I logout with FBSDKLoginManager, I have the Navigator transition back to the login view. However, the FBSDKLoginButton still shows as if I am still login (it says "Log Out"). When I click on the button, however, the click trigger a login action. Reloading the app reset the button to display correctly.

FBSDKLoginManager.logOut(callback: func)

The way I setup my app, it will automatically transition to the main view instead of the login view when the app detects that I have already logged in. However, when I logout, and transition back to the login view, the logout process is not done yet, so the app thinks that it is still login, and transition me back to the main view. Since the logOut method is async, it should also accept a callback.

Build failed when copying .xcodeproj over

Per the instruction, for example this one:

Option: Using the provided Xcode projects

Download and install the Facebook SDK for iOS into the standard location at ~/Documents/FacebookSDK. Follow the Getting Started guide to link your app's project with the Facebook SDK frameworks and set up the app delegate.

Add any of the following Xcode projects to your app's Xcode project:

node_modules/react-native-fbsdkcore/RCTFBSDKCore.xcodeproj
node_modules/react-native-fbsdklogin/RCTFBSDKLogin.xcodeproj
node_modules/react-native-fbsdkshare/RCTFBSDKShare.xcodeproj Follow the Linking Libraries (iOS) guide for each of them to make sure they're added correctly to your project's build targets.

I have installed the Facebook SDK, and configure the Info.plist file correctly, and setup the AppDelegate.m like this screen shot 2015-10-01 at 12 58 19 pm

My Build Phase looks like this screen shot 2015-10-01 at 12 59 49 pm.

And everything works fine, so I know that I setup Facebook SDK correctly.

I then continue with the instruction to copy the .xcodeproj folders over, and add their products to the Build Phase of the main project, and Xcode just say Build Failed without showing any error.

I removed the products from Build Phase, and everything works again (works as in no error, and I can see my app in simulation).

However, my button looks like this, and it does nothing (no alerts). screen shot 2015-10-01 at 1 03 31 pm

Do you know what could be wrong?

isCanceled vs. isCancelled

Hi,

I see in the examples of the LoginManager, that one has to check "result.isCanceled", however in the code it is "isCancelled".

Regards,
Philipp

Connecting the App to AppDelegate.m

the 6th step on the 'Getting Started with iOS SDK' is:

//  AppDelegate.m
#import <FBSDKCoreKit/FBSDKCoreKit.h>

- (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
  ];
}

However, The AppDelegate.m of the React Native app has already it's own didFinishLaunchingWithOptions, how to approach this?

Cheers

Document "Framwork Search Paths" setting

By default "Build Settings -> Search Paths -> Framework Search Paths" setting is set to $(inherited)$(PROJECT_DIR)
The Getting started page , guides you on how to add the framework, in step 4 but the AppDelegate.m gives an error in the line
#import <FBSDKCoreKit/FBSDKCoreKit.h>
It can be fixed by setting Framework Search Paths correctly , I thinnk it should be mentioned in Step 4 of Getting Started guide, but also in the Readme, maybe for people with a background in XCode is obvious, but for beginners makes instructions imposible to follow.

I didn't pull request myself , because I'm not sure if the Framework Search Path should point to $(PROJECT_DIR)/Frameworks or to ~/Documents/FacebookSDK
the instructions.

Tested with react-native (0.11.4).

Login Button Not working...

I followed the login button example from the readme and the I got:

Warning: Native component for "RCTFBSDKLoginButton" does not exist'

and the button actions and style is not working...

I installed facebook ios sdk from cocoapods:

PODS:
  - Bolts (1.2.0):
    - Bolts/AppLinks (= 1.2.0)
    - Bolts/Tasks (= 1.2.0)
  - Bolts/AppLinks (1.2.0):
    - Bolts/Tasks
  - Bolts/Tasks (1.2.0)
  - FBSDKCoreKit (4.5.1):
    - Bolts (~> 1.1)
    - FBSDKCoreKit/arc (= 4.5.1)
    - FBSDKCoreKit/no-arc (= 4.5.1)
  - FBSDKCoreKit/arc (4.5.1):
    - Bolts (~> 1.1)
  - FBSDKCoreKit/no-arc (4.5.1):
    - Bolts (~> 1.1)
    - FBSDKCoreKit/arc
  - FBSDKLoginKit (4.5.1):
    - FBSDKCoreKit

DEPENDENCIES:
  - FBSDKCoreKit
  - FBSDKLoginKit

SPEC CHECKSUMS:
  Bolts: d176cb1e0012175589e389a9db49b85e27787576
  FBSDKCoreKit: f335eaf6865e1e1597dee1debfb533045500da47
  FBSDKLoginKit: 225cc9a388a92916ee3f3bb14422017b6e44b65b

COCOAPODS: 0.37.2

maybe the cocoapods is the issue?

Create Working Example of manual login via native rather than web

I'd like to force my app to login via the native app when using a custom login button.

There are no working samples for manual login and the example in the readme references GlobalStore. What is this? I can't see it mentioned anywhere else in the code/samples/readme.

Readme installation instructions unclear

The instructions say "Drag the XCode projects from node_modules/react-native-sdk... into your XCode project navigator"

I believe the directory you mean is node_modules/react-native-fbsdkcore? If so, there are no XCode projects in that file. With other libraries, I've added something of the form *.xcodeproj, but there isn't anything like that in node_modules/react-native-fbsdkcore

This is what I see:
contents

Requiring unknown module

Hi,

After updating the package to 0.0.3, I got the same error than the one I got before with Login:

image

This also happens with AccessToken from Core.
I tried removing the packages (from npm and XCode), reinstalling them with npm install --save... But the errors are still here.

I don't understand since I got it to work last time and I only updated the packages :-(

Struggling with the initial setup & configuration

@philikon @cphackm

I just see you update the readme and added:

Add the `RCTFBSDK...` Xcode projects from `node_modules/react-native-sdk...` to your app's Xcode project.

cc80925

I still wasn't able to make it work. (same as before 'Warning: Native component for "RCTFBSDKLoginButton" does not exist')
see #5 (comment)

It would be very helpful if you added a step by step guide to the install section.
https://github.com/facebook/react-native-fbsdk#installation

few things the confused me (although I tried all the combinations)

Add the SDK to your Xcode Project

in the README.md it says:
The Xcode projects assume that it's installed in the standard location at ~/Documents/FacebookSDK

but in the FB developers guide it says:
Drag the FBSDKCoreKit.framework to Frameworks in Project Navigator. Create a new group Frameworks if it does not exist. in https://developers.facebook.com/docs/ios/getting-started#addSDK

to add to the confusion, we you do:
Add RCTFBSDKCore.xcodeproj from node_modules/react-native-fbsdkcore to your Xcode project navigator.
the added files already contain a ref to .framework file

Pods

it's not clear if I can use the SDK pods altogether or if the setup is different.

Can't find FBSDKLoginKit/FBSDKLoginKit.h

I'm an IOS newcomer. Took all of the steps described in the MD file, everything looks ok except i'm getting the FBSDKLoginKit/FBSDKLoginKit.h file not found build error. What could I have missed here ?

I have tried rebuilding, and adding the Facebook SDK path to frameworks. When i try to import these files in app delegate, there are no errors.

Steps i took:

  • npm install --save react-native-fbsdklogin
  • Add RCTFBSDKLogin.xcodeproj to Libraries
  • Add linRCTFBSDKLogin.a to build phases
  • Install Facebook SDK into standard location
  • Create a new group in Xcode named Frameworks
  • Drag Facebook SDK projects in Frameworks group

image

FBSDKLoginManagerInterface is undefined

I'm attempting to create my own login button using the FBSDKLoginManager. Everyt time I try to invoke a method on the login manager, I get some variation of this error:

screen shot 2015-08-10 at 2 29 09 pm

Here's my button code:

const {
    Image,
    StyleSheet,
    Text,
    View,
} = React

import RectangleButton from '../RectangleButton/index'

import FBSDKLogin from 'react-native-fbsdklogin'
const {
    FBSDKLoginManager
} = FBSDKLogin

// TODO: Replace with a real facebook icon
const FACEBOOK_ICON = require('image!bottomBar__rewards--on')

export default class FacebookLoginButton extends React.Component {
    static defaultProps = {
        readPermissions: [],
        publishPermissions: [],
        onLoginFinished: () => {},
    }

    render() {
        const {
            style,
        } = this.props
        const icon = <Image source={FACEBOOK_ICON} style={styles.icon}/>

        return (
            <RectangleButton
                color='#3B5997'
                textColor='white'
                onPress={() => this.signIn()}
                icon={icon}
                iconStyles={styles.icon}
                textStyle={styles.text}
                style={[style, styles.button]}>

                Sign In With <Text style={styles.facebookLabel}>Facebook</Text>
            </RectangleButton>
        )
    }

    signIn() {
        const {
            readPermissions,
            onLoginFinished,
        } = this.props

        FBSDKLoginManager.logInWithReadPermissions(readPermissions, onLoginFinished)
    }
}

const styles = StyleSheet.create({
    button: {
        flexDirection: 'row',
    },

    text: {
        flex: 3,
        fontSize: 14,
    },
    facebookLabel: {
        fontWeight: 'bold',
    },

    icon: {
        flex: 1,
    }
})

undefined is not an object

Hi,

I reset my entire project and I got it to compile. Only this time, I'm having "undefined is not an object" errors that I didn't have using the same code on 0.0.3:

image

(for the search record, this is about getCurrentAcessToken)

When commenting that part, I get the same thing with FBSDKNativeGraphRequestManager.addConnection.

I think I followed the installation steps correctly, but just in case, here's my project navigator:
image

Of course I'm available is further details are required to find a solution...
Thanks in advance!

"Unable to resolve module"

Hi,

Right after compiling my project, when I run it, a few errors are displayed in my terminal:

Unable to resolve module invariant from /Project/node_modules/react-native-fbsdkcore/js-modules/FBSDKGraphRequestManager.ios.js
Unable to resolve module NativeModules from /Project/node_modules/react-native-fbsdkcore/js-modules/FBSDKGraphRequestManager.ios.js

Is there any reason about it? Is it only me? Does it need to be solved on my side?
The app still works, by the way...

react-native 0.10 update > NSNumber

Hi,

Since React Native 0.10 update, I'm encoutering a new error:
"Argument 1 (NSNumber) of RCTFBSDKGraphRequestManager.startConnection must not be null"

I'm using fbsdk 0.0.5 and here's the full red box:
image

Thanks for your help!

Please update peer dependencies to support React Native 0.9.0

Hello,

I've just created new app from scratch using React Native 0.9.0
when trying to install react-native-fbsdklogin i get the following error:

npm WARN peerDependencies The peer dependency react-native@^0.8.0 included from react-native-fbsdklogin will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 14.4.0
npm ERR! argv "/Users/ranyefet/.nvm/versions/io.js/v2.5.0/bin/iojs" "/Users/ranyefet/.nvm/versions/io.js/v2.5.0/bin/npm" "install" "--save" "react-native-fbsdklogin"
npm ERR! node v2.5.0
npm ERR! npm  v2.13.2
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react-native@^0.8.0

Can you please upgrade the package to use 0.9.0?

Thanks,
Ran.

Requiring unknown module

image

Hi, I'm still having this weird problem where I can't use one third of the fbsdk:

  • fbsdklogin doesn't work unless I got fbsdkcore installed
  • fbsdkcore doesn't work unless I got fbsdkshare installed
  • fbsdkshare doesn't work no matter what (cf screenshot)

It's not urgent at all but it would be nice if you could take a look at it.

Can't find variable: GlobalStore

I have the following in my view and I get the GlobalStore can't find error.

var FBSDKLogin = require('react-native-fbsdklogin');

//init facebook login
  fbTouchHandler(event) {
    FBSDKLoginManager.setLoginBehavior(GlobalStore.getItem('behavior', 'native'));
    FBSDKLoginManager.logInWithReadPermissions([], (error, result) => {
      if (error) {
        alert('Error logging in.');
      } else {
        if (result.isCancelled) {
          alert('Login cancelled.');
        } else {
          alert('Logged in.');
        }
      }
    });
  }

How do I resolve this ?

How do I get an AccessToken from the login button?

I have a server with API endpoints and I want the user to login on their phone. Is there some way to get an access token from the initial request and send it to my API server so I can register them in my system? Or maybe a callback from facebook server that sends the user email, name, and token?

I just cant find the access token in the response object that is returned after they login.

JS SDK?

Hi,

Just a few questions by curiosity:

  • Are we supposed to use the JS SDK to access the user's data? Or is there something planned using only react-native-fbsdk?
  • Are there some states provided to detect if someone is already logged in? Or some tricks to create those?

Thanks!

readPermission set to get user_friends, but user always gets ask for permission for public profile only

Here is my code for the login button:

<FBSDKLoginButton
          onLoginFinished={(error, result) => {
            if (error) {
              alert('Error logging in.');
            } else {
              if (result.isCanceled) {
                alert('Login cancelled.');
              } else {
                FBSDKAccessToken.getCurrentAccessToken(
                    (token) => this.onFacebookLogin(token)
                  );
                }
                alert('Logged in.');
              }
            }
          }
          onLogoutFinished={() => alert('Logged out.')}
          readPermissions={['public_profile','email','user_friends']}
          publishPermissions={['publish_actions']}/>

but when I go to the Facebook page, the user is only asked to share public profile...

Running the sample app lead to error in main.m file

When I download the sample folder, do npm install and pod install, I will get a build succeeded, but then there is an error in main.m file, which has the following line highlighted:

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

and the error message is
thread 1:signal SIGABRT and

Oct  6 22:53:29  NHSample[84126] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  6 22:53:29  NHSample[84126] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  6 22:53:29  NHSample[84126] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2015-10-06 22:53:29.209 NHSample[84126:4665734] *** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010b632f65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010ac29deb objc_exception_throw + 48
    2   NHSample                            0x0000000107c4ef73 +[FBSDKInternalUtility checkRegisteredCanOpenURLScheme:] + 499
    3   NHSample                            0x0000000107c89d08 +[FBSDKAppInviteDialog initialize] + 88
    4   libobjc.A.dylib                     0x000000010ac2abff _class_initialize + 679
    5   libobjc.A.dylib                     0x000000010ac30d23 lookUpImpOrForward + 176
    6   libobjc.A.dylib                     0x000000010ac3f8bb objc_msgSend + 187
    7   NHSample                            0x0000000107db0266 -[RCTFBSDKAppInviteDialog init] + 134
    8   NHSample                            0x0000000107ccf447 -[RCTBatchedBridge registerModules] + 2711
    9   NHSample                            0x0000000107cce571 -[RCTBatchedBridge initWithParentBridge:] + 1633
    10  NHSample                            0x0000000107cdbd87 -[RCTBridge setUp] + 375
    11  NHSample                            0x0000000107cdb469 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] + 713
    12  NHSample                            0x0000000107d3bdf8 -[RCTRootView initWithBundleURL:moduleName:launchOptions:] + 152
    13  NHSample                            0x0000000107bfad5d -[AppDelegate application:didFinishLaunchingWithOptions:] + 189
    14  UIKit                               0x00000001097a94ca -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 272
    15  UIKit                               0x00000001097aa670 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3415
    16  UIKit                               0x00000001097b0e15 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755
    17  UIKit                               0x00000001097adff0 -[UIApplication workspaceDidEndTransaction:] + 188
    18  FrontBoardServices                  0x000000010e2217ac -[FBSSerialQueue _performNext] + 192
    19  FrontBoardServices                  0x000000010e221b1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    20  CoreFoundation                      0x000000010b55f0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    21  CoreFoundation                      0x000000010b554fcc __CFRunLoopDoSources0 + 556
    22  CoreFoundation                      0x000000010b554483 __CFRunLoopRun + 867
    23  CoreFoundation                      0x000000010b553e98 CFRunLoopRunSpecific + 488
    24  UIKit                               0x00000001097ad98d -[UIApplication _run] + 402
    25  UIKit                               0x00000001097b2676 UIApplicationMain + 171
    26  NHSample                            0x0000000107bfb23f main + 111
    27  libdyld.dylib                       0x000000010c84c92d start + 1
    28  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Login Button not working, also displaying red box

Hi! I'm having issues displaying the login button. I tried to follow a few examples with no luck. Can someone help? So far I have followed the iOS SDK and am seeing login events under the analytics tab. I have also tried to create ViewControllers.h and m. However, I'm not sure if that works.

This is similar to the first issue that is posted/closed.
Not sure if this matters...but I noticed the download for iOS SDK vs npm install --save has different files
the download from the getting started guide has FBSDKCoreKit.Framework while the other has RCTFBSDKCore.xcodeproj files

I'm not too sure which one to use

Thanks!

CocoaPods issues

Hi,

I'm new at CocoaPods, and I've just tried setting my project using it. I encountered 2 issues, but I'm not sure they are fbsdk-related:

First one is: Foundation.framework and JavaScriptCore.framework seem to miss...
image

Second one is: I can't open the file anymore since the original xcodeproj "is already opened from another project or workspace":

image

Thank you for your help!

Native component for "RCTFBSDKLoginButton" does not exist

Upon building the project, I get the warning as

2015-11-08 13:26:07.231 [warn][tid:com.facebook.React.JavaScript] 'Warning: Native component for "RCTFBSDKLoginButton" does not exist'

And the login button does not work. It is not even displayed.

Image

I am on node v5.0.0

My installation of react-native-fbsdklogin generated warning below

$ npm install --save react-native-fbsdklogin
[email protected] /Users/developer/workspace/EmergencyMe
├── UNMET PEER DEPENDENCY [email protected]
└── [email protected]

npm WARN EPEERINVALID [email protected] requires a peer of react-native@^v0.13.0 but none was installed.

However, I went ahead and followed the steps mentioned at https://github.com/facebook/react-native-fbsdk/tree/master/react-native-fbsdklogin#installation

My AppDelegate.m based on the information mentioned at https://developers.facebook.com/docs/ios/getting-started#delegate looks like below

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  [[FBSDKApplicationDelegate sharedInstance] application:application
                           didFinishLaunchingWithOptions:launchOptions];



  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"EmergencyMe"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [[UIViewController alloc] init];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];



  return YES;
}

I have created a Login.js which is exactly the same as https://github.com/facebook/react-native-fbsdk/blob/master/Sample/Login.js . My index.ios.js looks like below

'use strict';

var React = require('react-native');
var Login = require('./Login');

var EmergencyMe = React.createClass({


  render: function() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.ios.js
        </Text>
        <Text style={styles.instructions}>
          Press Cmd+R to reload,{'\n'}
          Cmd+D or shake for dev menu
        </Text>
      <Login style={styles.loginContainer}/>
      </View>

    );
  }

});

var styles = StyleSheet.create(require('./styles.js'));

AppRegistry.registerComponent('EmergencyMe', () => EmergencyMe);

What could be going wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.