Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'authorize' of undefined #173

Open
Surendhar95 opened this issue Oct 24, 2017 · 2 comments
Open

'authorize' of undefined #173

Surendhar95 opened this issue Oct 24, 2017 · 2 comments

Comments

@Surendhar95
Copy link

Surendhar95 commented Oct 24, 2017

I have followed all the steps to setup 'react-native-oauth' for android.
I want to create a new provider and authorize my client instance with that provider's server.For this I'm using the addProvider() method given in the doc.

This is the service I have written for the authentication:

`import OAuthManager from 'react-native-oauth';

const manager = new OAuthManager(<app_name>)

manager.addProvider({
'my_provider': {
auth_version: '2.0',
authorize_url: ,
access_token_url: <token_url>,
callback_url: 'http://localhost/[my_provider]', //DEEP LINK
}
});

manager.configure({
my_provider: {
client_id: <client_id>,
client_secret:<client_secret>,
redirect_uri:'http://localhost/[my_provider]' //DEEP LINK
}
});
module.exports = {
authManager: () => {manager.authorize('my_provider')
.then(resp => console.log('Your users ID'))
.catch(err => console.log(err));
}
}
`

But I get " 'authorize' of undefined " error when I call the authManager method.Am I doing anything wrong here.

@tavantzo
Copy link

tavantzo commented Oct 27, 2017

Did you try re-build the project?
e,g: react-native run-android`

I assume that you will get an error like

/home/george/workspace/myRNProject/node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerPackage.java:39: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: /home/george/workspace/myRNProject/node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:react-native-oauth:compileReleaseJavaWithJavac FAILED

`just ckeck this issue #156

@Surendhar95
Copy link
Author

Apparently the package was not linked properly in android.When I ran react-native link and rebuilt my project,it worked.

Anyway thanks @tavantzo .Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants