facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

Login Button not working, also displaying red box #25

Closed kent10ou closed 9 years ago

kent10ou commented 9 years ago

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!

tnguyen42 commented 9 years ago

Which version are you using and can I have a screenshot of your project manager? Also, did you think about linking the binaries with the libraries?

kent10ou commented 9 years ago

Not too sure how to check the versions that I'm using. I checked the link binaries with library. The FBSDkits are there...

tnguyen42 commented 9 years ago

Install this to check your package versions: https://www.npmjs.com/package/npm-check-updates Also, does your project manager look like this? image

kent10ou commented 9 years ago

I checked my versions and it says all dependencies have the latest version. Yes, my project manager matches yours. I actually forgot to put Bolts.framework in, but it still doesn't work :(

Another thing I noticed is fbsdk-loginkit.framework is red inside of RCTFBSDKLogin.xcode. I tried to link it again to that xcode, but that didnt work either... screen shot 2015-09-05 at 11 58 16 am

tnguyen42 commented 9 years ago

Ok, you probably didn't save the FacebookSDK into the right location: it is expected to be in ~/Documents/FacebookSDK.

image

Then also check that the libraries you import also come from that folder.

kent10ou commented 9 years ago

we did it!! it was because I didnt drag the whole RCTFBSDK node_modules folder into the library section rather than just the xcode file. :D :+1: now onto the session tokens and permissions...

Thanks so much for your help! much appreciated!

tnguyen42 commented 9 years ago

Glad it's solved ^^ Good luck!

jh222xk commented 9 years ago

@kent10ou: Where is this RCTFBSDK located? Can't find it anywhere.

kent10ou commented 9 years ago

Hey! make sure you npm install the 3 packages react-native-fbsdkcore react-native-fbsdkshare react-native-fbsdklogin

they should show up in your node_modules folder. This is more likely a linking issue. so make sure you correctly link the frameworks to XCode. You can follow the way that @tnguyen42 did it on the fourth comment.

jh222xk commented 9 years ago

@kent10ou: I believe it looks like in comment 4: Image

Getting this error:

duplicate symbol _llvm.embedded.module in: /Users/jesper/Documents/FacebookSDK/FBSDKLoginKit.framework/FBSDKLoginKit(FBSDKLoginButton.o) /Users/jesper/Documents/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKMaleSilhouetteIcon.o) ld: 184 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

When trying to build the xcode project.

tnguyen42 commented 9 years ago

I'd be very careful since a lot of files have moved with RN 0.11. Which version of React-Native are you using? If >= .11, I'd personally just wait for the next update :s

jh222xk commented 9 years ago

@tnguyen42: Using React Native >= 0.11.

harrisrobin commented 8 years ago

@kent10ou I'm not clear on how you solved this issue. Been trying to solve this for a few hours and I still don't get what you did. So you said that instead of moving "RCTFBSDKLogin.xcodeproj" you moved "RCTFBSDK". But where is this "RCTFBSDK"? I can't find it just like @jh222xk .

Here is what my node_modules looks like:

screenshot 2015-11-04 16 10 40

And here is my libraries in xcode:

screenshot 2015-11-04 16 12 13

Any help is appreciated! Thanks

dzhuowen commented 8 years ago

Please update your react-native-sdk version to release0.0.6 and follow the README doc. The installation with CocoaPod instruction will guide you through the process.

kent10ou commented 8 years ago

@HarrisRobin Hey! I did it manually without CocoaPod following the instructions on this link: https://developers.facebook.com/docs/ios/getting-started

So, what I did was drag the 3 node modules folders (core, login, share) into a frameworks folder that I created. I mimicked tnguyen42's project manager