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

No callback issue #47

Closed
alexandrzavalii opened this issue Jun 18, 2017 · 4 comments
Closed

No callback issue #47

alexandrzavalii opened this issue Jun 18, 2017 · 4 comments

Comments

@alexandrzavalii
Copy link

Sorry for opening many issues, but since you closed the previous one, I had to open it again :D

I had to add quick workaround to receive back the callback. I added setTimeout.

Maybe there is a better solution ?

https://github.com/auth0/react-native-auth0/blob/master/networking/index.js

    return fetch(url, options)
      .then((response) => {
        const payload = { status: response.status, ok: response.ok, headers: response.headers };
        setTimeout(() => null, 0); <!--- quick fix which solves the promise issue ---->
        return response.json()
          .then((json) => {
            return { ...payload, json };
          })
          .catch(() => {
            return response.text()
              .then((text) => {
                return { ...payload, text };
              })
              .catch(() => {
                return { ...payload, text: response.statusText };
              });
          });
      });
@hzalaz
Copy link
Member

hzalaz commented Jun 18, 2017

Can you build a sample gh repo I can see why it's not calling the callback?. On my end it's working with a bare bones app that only has auth0

@cocojoe
Copy link
Member

cocojoe commented Jun 19, 2017

@alexandrzavalii You might want to check out a preview chapter one of the sample code for hosted login.
https://github.com/auth0-samples/auth0-react-native-sample

I have tested in both iOS and Android with no issues.

@hzalaz
Copy link
Member

hzalaz commented Jul 6, 2017

@alexandrzavalii any news?

@hzalaz
Copy link
Member

hzalaz commented Aug 21, 2017

Cannot reproduce it so closing it. Please add more info if its still happening

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

3 participants