GoldenOwlAsia / react-native-twitter-signin

MIT License
167 stars 303 forks source link

Failed to get request token in android and ios. #203

Open kamalkishor8878 opened 8 months ago

kamalkishor8878 commented 8 months ago

Hello Team

i am facing a issue with this library ( "Failed to get request token" ) Android, IOS both platform.

I also try it with in a fresh project and followed the Twitter app setup process or i got the consumer and secret key's. But when i requesting with this credentials it is returning the error ("Failed to get request token") some time before it was working in other project but after install the node modules it stopped working.

Now i think my Twitter app and its callbacks setup is right.

I checked the Logcat in android studio and here is the my issue. Screenshot 2023-11-01 at 1 27 27 PM

I saw the code inside the OAuthController file Inside this startAuth function is calling ( oAuth1aService.requestTempToken)

I think (oAuth1aService.requestTempToken) is throwing Error so inside the newRequestTempTokenCallback function failure function is calling, and it is returning a error message (Failed to get request token)

It is the error response in my node server

{"nativeStackAndroid":[{"lineNumber":94,"file":"OAuthController.java","methodName":"failure","class":"com.twitter.sdk.android.core.identity.OAuthController$1"},{"lineNumber":191,"file":"OAuth1aService.java","methodName":"failure","class":"com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1"},{"lineNumber":48,"file":"Callback.java","methodName":"onFailure","class":"com.twitter.sdk.android.core.Callback"},{"lineNumber":92,"file":"DefaultCallAdapterFactory.java","methodName":"run","class":"retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1$2"},{"lineNumber":942,"file":"Handler.java","methodName":"handleCallback","class":"android.os.Handler"},{"lineNumber":99,"file":"Handler.java","methodName":"dispatchMessage","class":"android.os.Handler"},{"lineNumber":201,"file":"Looper.java","methodName":"loopOnce","class":"android.os.Looper"},{"lineNumber":288,"file":"Looper.java","methodName":"loop","class":"android.os.Looper"},{"lineNumber":7872,"file":"ActivityThread.java","methodName":"main","class":"android.app.ActivityThread"},{"lineNumber":-2,"file":"Method.java","methodName":"invoke","class":"java.lang.reflect.Method"},{"lineNumber":548,"file":"RuntimeInit.java","methodName":"run","class":"com.android.internal.os.RuntimeInit$MethodAndArgsCaller"},{"lineNumber":936,"file":"ZygoteInit.java","methodName":"main","class":"com.android.internal.os.ZygoteInit"}],"userInfo":null,"message":"Failed to get request token","code":"USER_CANCELLED"}

Please help me to fix my issue because it's urgent.

Thank you.

hitesh810 commented 8 months ago

Check this post Sign in with Twitter users must whitelist callback URLs https://twittercommunity.com/t/action-required-sign-in-with-twitter-users-must-whitelist-callback-urls/105342

https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1310#issuecomment-397343370

and may be this will help you try to change callback url https://stackoverflow.com/questions/33228235/failed-to-get-request-token-on-android-m-running-devices

Ryan-Y-AIS commented 8 months ago

Facing a same issue, @kamalkishor8878 Did you find a any solution ?

kamalkishor8878 commented 8 months ago

No i didn't found the solution.

I have tried another twitter lib.

npm i @hackinggate/react-native-twitter-signin npm i react-native-login-twitter npm i react-native-twitter-auth npm i @cutii/react-native-twitter-signin v0.0.4 npm i react-native-twitter ( did not try on it because last version released was 6 year ago) Most of these library is frocked from npm i GoldenOwlAsia-react-native-twitter-signin And i have also tried with diffrent sdk versions.

com.twitter.sdk.android:twitter-core:3.0.0 com.twitter.sdk.android:twitter-core:3.1.0 com.twitter.sdk.android:twitter-core:3.1.1 com.twitter.sdk.android:twitter-core:3.2.0 com.twitter.sdk.android:twitter-core:3.3.0 Now i am trying to do with the twitter api's

https://api.twitter.com/oauth/request_token https://api.twitter.com/oauth/authorize But unable to get the authorised user detail.

kamalkishor8878 commented 8 months ago

Check this post Sign in with Twitter users must whitelist callback URLs https://twittercommunity.com/t/action-required-sign-in-with-twitter-users-must-whitelist-callback-urls/105342

parse-community/Parse-SDK-iOS-OSX#1310 (comment)

and may be this will help you try to change callback url https://stackoverflow.com/questions/33228235/failed-to-get-request-token-on-android-m-running-devices

Thanks for sharing these link's, I have checked these link and didn't get the solution.

Ryan-Y-AIS commented 8 months ago

No i didn't found the solution.

I have tried another twitter lib.

npm i @hackinggate/react-native-twitter-signin npm i react-native-login-twitter npm i react-native-twitter-auth npm i @cutii/react-native-twitter-signin v0.0.4 npm i react-native-twitter ( did not try on it because last version released was 6 year ago) Most of these library is frocked from npm i GoldenOwlAsia-react-native-twitter-signin And i have also tried with diffrent sdk versions.

com.twitter.sdk.android:twitter-core:3.0.0 com.twitter.sdk.android:twitter-core:3.1.0 com.twitter.sdk.android:twitter-core:3.1.1 com.twitter.sdk.android:twitter-core:3.2.0 com.twitter.sdk.android:twitter-core:3.3.0 Now i am trying to do with the twitter api's

https://api.twitter.com/oauth/request_token https://api.twitter.com/oauth/authorize But unable to get the authorised user detail.

Thank you for your reply, I think twitter change their api and old version of react-native-twitter-signin library is not supporting latest version of twitter api

jotilohana commented 6 months ago

any update on this?

devlprkhan commented 6 months ago

Any update?

kamalDevk commented 6 months ago

Still searching about it in free time, developer is facing the same issue. I don't fount any update.

https://twittercommunity.com/t/can-not-login-sign-in-to-twitter-from-react-native-application/208346