react-native-oauth: cannot read property 'configureProvider' of undefined

Hi, as I made reference to here https://github.com/fullstackreact/react-native-oauth/issues/14 I’m having an issue with the oath on Android. Do I need to configure the manager differently based on platform? At present my code looks like this

const manager = new OAuthManager('MyAPp');
const config = {
  facebook: {
    client_id: 'MY_CLIENT_ID',
    client_secret: 'MY_CLIENT_SECRET',
  },
};
manager.configure(config);

It works amazingly (Thanks @auser !!) on ios, but in android everything about the manager is then coming up as undefined. I removed all my promises handling etc to just strip it back to console logging the manager variable but I was getting 'cannot read property ‘configureProvider’ of undefined and it wouldn’t go any further.

Is this a bug or is this just user error? I (think) I;ve read the docs quite extensively and everything seems as it’s supposed to be? Cheers

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 28 (6 by maintainers)

Most upvoted comments

I have the same problem in iOS.

react_native_debugger

Hi @auser , I’m having the same “configureProvider is undefined” issue on iOS. I tried the react-native unlink and react-native link, as well, and that didn’t resolve the issue. I took a look at the set up you have in the demo link you referenced above and nothing is glaringly different. Here’s my set up:

componentWillMount(){
        const manager = new OAuthManager('my_app_name');

        const config =  {
            twitter: {
                consumer_key: 'my_consumer_key',
                consumer_secret: 'my_consumer_secret'
            },
            facebook: {
                client_id: 'my_client_id',
                client_secret: 'my_client_secret'
            }
        };
        manager.configure(config);
	this.manager = manager;
}

I’m having the same problem in iOS. Has this been resolved?

Ok I’ve figured it out. For me I haven’t noticed Next, navigate to the neighboring "Build Phases" section of project settings, find the "Link Binary with Library" drop down, expand it, and click the "+" to add libOAuthManager.a to the list. in README.

I’m relatively new to react-native, but is there any reason why react-native link can’t do this for us @auser ? Maybe if we discuss this I could help out and learn how automatic linking works.

I have same issue like @ozsirma