Open ElixirMike opened 5 years ago
Just to close the loop on this...after several more efforts, I got this working. I'd be happy to write up the detailed instructions if anyone wants them, but here is the gist.
I went back and did a clean react-native init fbtest to have a clean slate and then followed the instructions from here: https://developers.facebook.com/docs/react-native/getting-started
Luckily, with a clean install, everything just worked, I had it up/running in 30 minutes. I then reviewed the app and compared it to mine. Here are the discrepancies that through me off and lead me down many rabbit holes.
So, first step was to remove the reference in the pod file...it should have no references to any of the SDK files.
Next (ensure the facebook SDK's are downloaded into the ~/Documents/FacebookSDK folder. Extract the contents of the zip into the folder.
After this, I tried a build and got some random compile error. My project is much bigger than the default init project created. After digging into this for an hour or so, I found it had to do with hitting some file size open limit. I found this article that shows how to change your limits on a MAC http://blog.mact.me/2014/10/22/yosemite-upgrade-changes-open-file-limit
I tried to build again, and this time it built, but I was back to the error when clicking on the Login button of "null not valid " in referen to the loginManager . I had seen this error before.
Finally, to resolve this, I followed the instructions someone posted about add the the RCTFBSDK.xcodeproj to the project's libary and adding the lib.a file into "link bindings" .
After the above, and following the original instructions, It worked. Wasted a good day on that...but it seems to be the norm when doing react-native development with 3rd party libs
Happy to share more if anyone needs more details.
I'm sorry you had so much frustration with this library. There are some issues right now. If you look at the latest pull requests that have been merged or opened you will see that a new release has been forming which will solve many of the issues. I believe that release will bring an updated documentation as well.
the current master branch doesnt work on ios at all. Gives an error
error: Build input file cannot be found: '/../app/node_modules/react-native-fbsdk/iOS/RCTFBSDK/core/RCTFBSDKInitializer.m'
And if I look at the code, there is no such file indeed commited to master. Should it be there?
RCTFBSDKInitializer.m
was removed here https://github.com/facebook/react-native-fbsdk/commit/7af350e4354438f67b5d4aaa6e7a27c8a4f84b3a.
You can just add it back and it will work.
@superandrew213 thanks, but it is not a sustainable solution :), everyone is gonna have this problem
I am only giving you a temp workaround. You can have a look at the repo to find out why it was removed to investigate it further and make a PR.
@janicduplessis is RCTFBSDKInitializer
still required somewhere for iOS.
After hours, I can make it work with logInWithReadPermissions
:
yarn add react-native-fbsdk
RCTFBSDK.xcodeproj
to iOS xcworkspace.libRCTFBSDK.a
to Link Binary With Libraries in Build Phases.https://developers.facebook.com/docs/ios/downloads/
FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework
to Frameworks folder. Check if they are in Link Binary With LibrariesFBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework
to Frameworks folder of RCTFBSDK.xcodeproj
(remove the old ones)@tuledev logInWithReadPermissions
and logInWithWritePermissions
have been replaced with logInWithPermissions
in the last release.
@superandrew213 thank I noted.
I am also having troubles with react-native-fbsdk. I have gone through all of the steps outlined by @ElixirMike , but now I see the following when building RCTFBSDK.xcodeproj:
Showing Recent Issues
RCTFBSDK/core/RCTConvert+FBSDKAccessToken.m:28:13: No visible @interface for 'FBSDKAccessToken' declares the selector 'initWithTokenString:permissions:declinedPermissions:expiredPermissions:appID:userID:expirationDate:refreshDate:dataAccessExpirationDate:'
It almost seems as if the project has the wrong header search paths. Is this a known issue as well?
Ok, as a follow up to my last comment, it seems like I was using an old versiuon of ios_setup.js, as the url given here returns 404:
https://developers.facebook.com/docs/react-native/configure-ios
So this explains why my frameworks and RCTFBSDK were out of sync, however it is not clear how to download the latest FacebookSDK without cocoapods. This page:
https://developers.facebook.com/docs/ios/downloads
leads me here:
which directs me here:
https://developers.facebook.com/docs/ios
which leads here:
https://developers.facebook.com/docs/ios/componentsdks
whidch leads right back to the github page.
How can I download the lates sdk without cocoapods?
Also stuck at the step trying to download ios_setup.js
Also stuck at the step trying to download ios_setup.js
same
Figured it out, don't follow these instructions. See: https://github.com/facebook/react-native-fbsdk/pull/551#issuecomment-50654828
Basically, just follow the instructions on the github page, except ignore the part where it says to skip step 2. You need to use CocoaPods for the install.
Thanks to the maintainers for their hard work on this project.
Seems like we are all seeing these issues:
ios_setup.js
has been removed but is still in official documentationhttps://developers.facebook.com/docs/ios
https://developers.facebook.com/docs/ios/componentsdks
https://github.com/facebook/facebook-objc-sdk
When I used ios_setup.js
last year to set this up at my previous job it only took a few minutes. Can we please bring back this convenience script?
Has anyone gotten this API working on the latest version without cocoapods?
The Facebook documentation says to switch to cocoapods if you installed manually before but I would prefer not to: https://developers.facebook.com/docs/app-events/upgrade-guide/
I followed this (https://github.com/facebook/react-native-fbsdk/issues/574) and other issues to get the ios app to build without using cocoapods.
Now there is issues with the API functionality - as described here: https://github.com/facebook/react-native-fbsdk/issues/583
has any every had an error on IOS about RCTFBSDKZGraphRequestConnectionContainer.m? I'm getting errors like these when I link the react-native-sdk library to my project. I'm using version 0.10.3 and my react native version is 0.57.8
I have spent the entire day trying to implement sign-in with Facebook on Android and IOS. After about 1 hour, I was able to work through all the issues on android, many of which are not documented in the installation guide, but got it working. I then started working on IOS.
7 hours later, I still can't get this to work. I, of course, have followed the provided installation instructions to no avail. After searching /reading /hacking, trying different SDK verions in the Pod files, I at least have it to a point where it builds and when I click on the "Login" button, it doesn't throw the "null LoginManager" error.
I am now stuck at the point where it just throws an error when I click to login of "Login failed". There are multiple threads on this issue, ranging from changing the pod SDK versions back to 4.38, or some say 4.40. Others say to remove the pod reference to "react-native-fbsdK" and include "FacebookSDK" . And there is things about enabling key-chain sharing, etc.
But after trying all of these...I still cannot get this simple Login button to work. Would it be possible to have a defined, reproducible guide, listing which specific versions of the SDK's, react-native-FBSDK and anything else required to actually get a working version? A detailed step-by-step that covers everything, including hacks required, etc.
If we can start at something that can be reproduced and working, it will make it much easier to troubleshoot our existing projects and hopefully find a solution. Thx.