GithubHelp home page GithubHelp logo

Comments (18)

amccloud avatar amccloud commented on May 28, 2024

I'm seeing the same error. Looks like this was added by facebook/react-native@95b9dd3

I've checked the call-site and connectionId is 0. I've also tried making connectionId start from 1.

from react-native-fbsdk.

amccloud avatar amccloud commented on May 28, 2024

I completely looked over the other arguments. The issue is that the timeout argument must be set now.

from react-native-fbsdk.

amccloud avatar amccloud commented on May 28, 2024

It appears that the callback also can't be null. Work around is to dispatch your request manually instead of calling send() on it.

FBSDKGraphRequestManager.batchRequests([profileRequest], function() {}, 60);

from react-native-fbsdk.

tnguyen42 avatar tnguyen42 commented on May 28, 2024

Should we wait for a fix or should I manually patch it for the moment? ^^

from react-native-fbsdk.

mponizil avatar mponizil commented on May 28, 2024
FBSDKGraphRequestManager.batchRequests([profileRequest], function() {}, 60);

suppresses the red error screen, but still getting The operation couldn’t be completed in Chrome debugger. My code:

var fetchFriendsRequest = new FBSDKGraphRequest((error, result) => {
  console.log('FBSDKGraphRequest', error, result);
}, '/me/friends?fields=id,name');

User has been authenticated and authorized user_friends read permissions.

[email protected]
[email protected]

Edit: sorry -- I think this was from not having FB callback in AppDelegate.

from react-native-fbsdk.

ceditoph avatar ceditoph commented on May 28, 2024

Doesn't null evaluate to 0?
Where is the connectionID being set?

from react-native-fbsdk.

amccloud avatar amccloud commented on May 28, 2024

@ceditoph Sorry, connectionID is correct. The issue is the timeout and callback are null.

from react-native-fbsdk.

ceditoph avatar ceditoph commented on May 28, 2024

@amCloud thanks. Where are you assigning profileRequest? I don't see an example.

from react-native-fbsdk.

kent10ou avatar kent10ou commented on May 28, 2024

Hey I'm working with Ceditoph. We're diving into the source code and can't figure out the proper args to pass in

constructor(callback: (error: ?Object, result: ?Object) => void, graphPath: string, parameters: ?Object, tokenString: ?string, version: ?string, HTTPMethod: ?string) {
this.callback = callback;
this.graphPath = graphPath;
this.parameters = parameters ? parameters : {};
this.tokenString = tokenString;
this.version = version;
this.HTTPMethod = HTTPMethod;
this.graphErrorRecoveryDisabled = false;
}

from react-native-fbsdk.

amccloud avatar amccloud commented on May 28, 2024

@ceditoph it is something like this

var profileRequest = new FBSDKGraphRequest((error, result) => {
  if (error) {
    alert('Error making request.');
  } else {
    // Data from request is in result
  }
}, '/me');

from react-native-fbsdk.

ceditoph avatar ceditoph commented on May 28, 2024

@amccloud thanks! it's working. I don't really like how they have it set up, but the timeout is a solid workaround!
@kent10ou and I will keep at it.

from react-native-fbsdk.

ceditoph avatar ceditoph commented on May 28, 2024

@amccloud so we have it working without getting an error, but how do I grab the result of batch running profileRequest?
Can I use a promise, like .then()?

Thanks again

from react-native-fbsdk.

ceditoph avatar ceditoph commented on May 28, 2024

@amccloud nvm. I see the result from the output of fetchFriends

from react-native-fbsdk.

khanetor avatar khanetor commented on May 28, 2024

It's been a while, is this considered a bug?

from react-native-fbsdk.

valamelkor avatar valamelkor commented on May 28, 2024

Yep. This is a bug from my point of view. It prevented us from upgrading from 0.9.

The actual working piece of code:

FBHelper.getFriends = function (success, fail)
{
  var fetchFriends = new FBSDKGraphRequest((error, result) => {
    if (error)
    {
      console.log("->FBHelper.getFriends Error: ", error);
      fail(error);
    }
    else
    {
        success(result);
    }
  }, '/me/friends?fields=id,name,picture' 
  );

  //fetchFriends.start(); //works before 0.10
  FBSDKGraphRequestManager.batchRequests([fetchFriends], function() {}, 60); // works for 0.10 and later
};

Thanks @amccloud for workaround, but for me it took some time to figure out how it should be implemented. :)

from react-native-fbsdk.

weeweewee avatar weeweewee commented on May 28, 2024

New to react-native and fbsdk here but after looking at the source code, assigning a timeout to .start(60) seemed to be a workaround as well. However, RCTFBSDKGraphRequestManager doesn't seem to like the fact that the callback is null.
A simple fix to GraphRequest.ios.js/start(timeout: number) where changing the callback from null to function() {} allows us to use the start function once again.
Feels hackish and I'm not too confident about this so I'm leaving it as a comment here.

from react-native-fbsdk.

shaneosullivan avatar shaneosullivan commented on May 28, 2024

Any movement on getting this properly fixed without hacks? The SDK is well behind RN in general, working with v0.8.

from react-native-fbsdk.

dzhuowen avatar dzhuowen commented on May 28, 2024

This issue has been handled by #44

from react-native-fbsdk.

Related Issues (20)

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.