Piroro-hs / react-native-twitter

A Twitter API client library for React Native. Currently not maintained as my main motivation of creating this library was to use the User Streams API.
MIT License
39 stars 20 forks source link

Not redirected back to the app #6

Open hanalaydrus opened 7 years ago

hanalaydrus commented 7 years ago

I already sign in and redirected to callback url but can't get redirected back to the app. Any solution?

My code looks like this

    const tokens = {
      consumerKey: TWITTER_CONSUMER_KEY,
      consumerSecret: TWITTER_CONSUMER_SECRET
    }
    const redirectUrl = 'http://localhost/twitter'
    auth(tokens, redirectUrl)
      .then(resp => console.log(resp))
      .catch(err => console.log(err))
Piroro-hs commented 7 years ago

redirectUrl should not have web protocols (http, https). It should be link inside the app. See React Native docs for more info.

pakicoder123 commented 7 years ago

Hi, I apologize in advance for the length of this issue.

I have a quick question on this as well. I set up deep linking in the android manifest and put the callback as "sharebert://explorescreen". The code properly opens up the chrome browser for twitter authorization, but when it tries to redirect it gives an error in the browser saying that the link isn't found.

I looked this up online and saw people saying on stackoverflow that their deep links weren't working when they had the fbsdk installed in the app, but those issues were only for iOS, and I'm writing my code for Android. I also have react-native-fbsdk installed.

Do you think I am doing something wrong setting up the deep link or is it because of fbsdk? I tried doing this in a test app as well and it worked, so I'm not sure what's wrong. Thank you for taking the time to read this, I appreciate your help

Piroro-hs commented 7 years ago

That is strange. Could you share your AndroidManifest.xml?

vijayst commented 7 years ago

My deep link is working. But it is triggered with two query string: oauth_token and oauth_verifier. What should I do with these two? How do I get the screen name of the user?