'authorize' of undefined
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:
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.
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
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