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

auth(tokens, callbackUrl[, options]) not redirecting back to application #14

Open
KeanuTomatoMomotaro opened this issue Nov 21, 2017 · 1 comment

Comments

@KeanuTomatoMomotaro
Copy link

KeanuTomatoMomotaro commented Nov 21, 2017

After the application has opened the browser to authenticate the user, it does not redirect back to the application.

I've unlocked the "lock callback url" settings in the twitter developer apps settings, and supplied these parameters to my manifest:

<application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:scheme="appName"
                android:host="main"
            />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

Then the method i used to sign in would be:

signInTwitter(){
      var tokens= {
        consumerKey:         'xxx',
        consumerSecret:      'xxx,         
      };

      callbackUrl = 'appName://main'
      
      auth(tokens, callbackUrl)
      .then((credentials) => {
        console.log(credentials)
      }).catch(console.error);
    }
@ahmedu007
Copy link

You have to put something like https://appName in the twitter app where you got your keys from. Also what I've found lately is twitter doesn't really work well with Camel case so I'd suggest renaming your app to appname, or something else all lowerCase.

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