Giter Site home page Giter Site logo

Comments (13)

mark-muhammad avatar mark-muhammad commented on June 17, 2024

@muhammadsarim555 i have the same problem, have you found any solution?

from react-native-simple-twitter.

muhammadsarim555 avatar muhammadsarim555 commented on June 17, 2024

@mark-muhammad i did not find this solution

from react-native-simple-twitter.

watanabeyu avatar watanabeyu commented on June 17, 2024

Hi there!
I will check this, so please wait!
sorry.

FYI, please let me know your information.

  • OS
  • Device
  • react-native-simpel-twitter version
  • React Native version

from react-native-simple-twitter.

muhammadsarim555 avatar muhammadsarim555 commented on June 17, 2024

@watanabeyu WIndow 7 , expo sdk version 31 , device android LG

from react-native-simple-twitter.

mark-muhammad avatar mark-muhammad commented on June 17, 2024

Mine is slightly different

  • OS: macOS 10.14
  • Device: android 5.1.1
  • react native: 31.0.0
  • react-native-simple-twitter: 2.0.2

Also, I've found that in android, callback URL was not called.

from react-native-simple-twitter.

watanabeyu avatar watanabeyu commented on June 17, 2024

@mark-muhammad
I check it on below environment.

  • OS: Android 7.0
  • Device: HUAWEI P10 lite
  • react-native-simpel-twitter version: 2.2.0
  • React Native version(expo):v32

I can work fine.
Please check your environment working at this example.

from react-native-simple-twitter.

mark-muhammad avatar mark-muhammad commented on June 17, 2024

@watanabeyu I did follow the example but still didn't work. Do you think the version I used could be the problem? If I really should update the lib, what version do you think still compatible with react native v31? Because I once used v32 but got a problem which forced me to use v31 instead.

from react-native-simple-twitter.

watanabeyu avatar watanabeyu commented on June 17, 2024

@mark-muhammad
umm... My Android phone is work fine.
Could you show me the source code?

from react-native-simple-twitter.

mark-muhammad avatar mark-muhammad commented on June 17, 2024

@watanabeyu I just updated to v2.3.0 and still didn't work. Anyway, here is my code related to the login process. What made curious is that it worked fine in iOS.

onGetAccessToken = ({ oauth_token, oauth_token_secret }) => {
    console.log("TOKEN_SET: " + oauth_token + " | " + oauth_token_secret)
}

onSuccess = (user) => {
    console.log(user);
    TwitterID = user.id;
    Name = user.name;
    Email = user.email;

    this.loadAccessKeysViaTwtitter(TwitterID, Name, Email);
}

onClose = (e) => {
    console.log("press close button")
}

onError = (err) => {
    console.log(err)
}

<TWLoginButton 
    containerStyle={styles.loginContainer}
    style={styles.loginButton}
    textStyle={styles.loginButtonText}
    onGetAccessToken={this.onGetAccessToken}
    onSuccess={this.onSuccess}
    closeTextStyle={styles.loginCloseText}
    onClose={this.onClose}
    onError={this.onError}>
    <SocialIcon
        title='TWITTER LOGIN'
        button
        iconSize={ 18 }
        iconStyle={{ marginTop: -8, marginBottom: -8 }}
        fontStyle={{ fontSize: 12 }}
        style={{width: '90%', height: 40, borderRadius: 2, alignSelf: 'center'}}
        type='twitter'
    />
</TWLoginButton>```

from react-native-simple-twitter.

mark-muhammad avatar mark-muhammad commented on June 17, 2024

@watanabeyu I recently found out that my callback was actually hit withquery string oauth_verifier which you used to filter here
const match = webViewState.url.match(/\?oauth_token=.+&oauth_verifier=(.+)/);

But somehow, WebView didn't read the URL, and since I have redirection in the callback, WebView recognized only the redirected URL, ignoring callback URL. Do you think it is due to how WebView in android handles redirection? Do you I should change the logic in the callback URL?

from react-native-simple-twitter.

mark-muhammad avatar mark-muhammad commented on June 17, 2024

@watanabeyu Never mind. I just resend the query string which twitter sent to my callback URL to the redirection inside my callback. In short, in my callback URL, I did this
redirect($url . $_SERVER['QUERY_STRING']);

It's probably just a workaround, but if WebView in android only reads the redirected URL, I guess this is the way to go.
@muhammadsarim555 Could this happen to be your case too?

By the way, thank you for the good lib @watanabeyu

from react-native-simple-twitter.

muhammadsarim555 avatar muhammadsarim555 commented on June 17, 2024

@mark-muhammad i did not show the **web view. ** i was just unable to get token

from react-native-simple-twitter.

watanabeyu avatar watanabeyu commented on June 17, 2024

@mark-muhammad @muhammadsarim555
Sorry to be late to response.
I fixed webview bug, and update package v2.4.0

please use this version.

from react-native-simple-twitter.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.