# Callback Failing in React Native with Twitter Login

**URL:** <https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290>\
**Category:** Get Help\
**Tags:** twitter\
**Created:** [October 27, 2018, 2:49am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290 "2018-10-27T02:49:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark100](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mark100/32/9451_2.png) [@mark100](https://community.auth0.com/u/mark100)\
**Post date:** [October 27, 2018, 2:49am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/1 "2018-10-27T02:49:52Z")

</div>

I am trying to get the 00-login sample app (React Native with Twitter login) to work. The login is succeeding on the Twitter side (I know this mainly because I am getting an email from Twitter warning me about a login from a new device).

I am running the app on an Android emulator with ‘react-native run-android’.

The callback I have set (per the sample app instructions) in Auth0 application settings is:

```
com.auth0sample://myTenantName.auth0.com/android/com.auth0sample/callback

```

My callback URL setting in the Twitter application is:

```
https://myTenantName.auth0.com/login/callback

```

My AndroidManifest.xml has:

The emulator shows this error page after entering credentials in Twitter’s login page:

 ![55%20PM](https://global.discourse-cdn.com/auth0/original/2X/f/f02d9fc851326dcdebf52d0514f7b37e8d3784be.png)

The “Try It” button on Connections/Social in the Auth0 dashboard says “It Works”.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 30, 2018, 12:40pm UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/3 "2018-10-30T12:40:29Z")

</div>

Hey @mark100 !

At first glance everything seems fine. Can you let me know what version of React Native do you use? The error reads like it’s not configured correctly on the android side. Thanks in advance for providing more info!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 30, 2018, 8:40pm UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/4 "2018-10-30T20:40:40Z")

</div>

It might be also because of the browser you use, which is not correctly redirecting URL with custom scheme. This should work fine on most common browsers. Can you also try on a different browser/Android phone?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![mark100](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mark100/32/9451_2.png) [@mark100](https://community.auth0.com/u/mark100)\
**Post date:** [October 31, 2018, 2:52am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/5 "2018-10-31T02:52:23Z")

</div>

Konrad,

I am using react-native 0.47.2 in this project.

I had tried it on a couple different emulators with the same result.

I tried it again on a real device and used the Chrome browser. This time login was successful (as before) but instead of callback failing it never left the “Redirecting you back …” page. I guess that’s an “improvement” but this would require the user to manually close the browser.  
Thanks,

Mark

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [October 31, 2018, 10:10am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/6 "2018-10-31T10:10:35Z")

</div>

Is your package name `com.auth0sample` in the manifest file? Are you using the same package name in the `intent-filter` configuration?

It seems as if the callback URL (com.auth0sample://…) is not being recognized by the system.

---

<div class="post-metadata">

**Author:** ![mark100](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mark100/32/9451_2.png) [@mark100](https://community.auth0.com/u/mark100)\
**Post date:** [October 31, 2018, 11:05pm UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/7 "2018-10-31T23:05:00Z")

</div>

I put the info from manifest in the original post but it didn’t show up.

I will try again:

```
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.auth0sample"

```

…

```
 <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
  <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
          android:host="pokervane.auth0.com"
          android:pathPrefix="/android/${applicationId}/callback"
          android:scheme="{applicationId}" />
    </intent-filter>

```

…

applicationId is “com.auth0sample”.

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [November 1, 2018, 11:56am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/8 "2018-11-01T11:56:44Z")

</div>

The `android:scheme` is missing the dollar sign. It should be:

```xml
<data
[...]
android:scheme="${applicationId}" />

```

If that doesn’t work (try it first), can you try replacing the two `${applicationId}` occurrences with `com.auth0sample`? Sorry I’m asking you to try things blindly, but I’m having troubles with my Java VM at the moment so I can’t reproduce.

So that you get this:

```xml
<intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
  <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
          android:host="pokervane.auth0.com"
          android:pathPrefix="/android/com.auth0sample/callback"
          android:scheme="com.auth0sample" />
    </intent-filter>

```

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 5, 2018, 10:13am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/9 "2018-11-05T10:13:12Z")

</div>

Hey @mark100!

Have you had time to try what Nicolas suggested and solve your problem?

Let us know if that worked!

---

<div class="post-metadata">

**Author:** ![mark100](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mark100/32/9451_2.png) [@mark100](https://community.auth0.com/u/mark100)\
**Post date:** [November 5, 2018, 11:04pm UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/10 "2018-11-05T23:04:01Z")

</div>

Konrad,

I have not had a chance to get back to it yet. Of course I will let you know the status when I do.

Thanks,

Mark

---

<div class="post-metadata">

**Author:** ![mark100](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mark100/32/9451_2.png) [@mark100](https://community.auth0.com/u/mark100)\
**Post date:** [November 9, 2018, 5:18am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/11 "2018-11-09T05:18:54Z")

</div>

The missing $ appears to have been the problem.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 9, 2018, 8:02am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/12 "2018-11-09T08:02:06Z")

</div>

Perfect! Glad that you made it!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 9, 2018, 8:06am UTC](https://community.auth0.com/t/callback-failing-in-react-native-with-twitter-login/17290/13 "2018-12-09T08:06:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
