GithubHelp home page GithubHelp logo

Comments (9)

ashishchopra avatar ashishchopra commented on June 8, 2024

Is there any update on this?

from auth0-react-native-sample.

lbalmaceda avatar lbalmaceda commented on June 8, 2024

Hi @beardaway. Did you download this sample project from github or follow a guide? Please drop the link to such article in that case so we can assist you.

from auth0-react-native-sample.

pejowei avatar pejowei commented on June 8, 2024

Hi,

In case this helps anyone, I think the guide and repo need a couple updates.

TL;DR:

  • I faced a couple of issues, but was eventually able to get it running.

  • I think npm audit fix causes problems with linking libraries, that's the saga written below.

  • The Allowed Callback URL and Allowed Logout URL's generated by Auth0's react-native quickstart tutorial include the incorrect Bundle ID for ios. The Download Sample popup uses URLs generated with Bundle ID: "auth0.samples.Auth0Samples", but the bundle ID in XCode project file is "org.reactjs.native.example.Auth0Samples". So in my Auth0 Application settings I used this for both allowed callback and allowed logout: org.reactjs.native.example.Auth0Samples://MY_TENANT.auth0.com/ios/org.reactjs.native.example.Auth0Samples/callback

  • Minor issue, but when I select the Logout button in sample app, I receive an alert "Auth0Samples" Wants to Use "auth0.com" to Sign In. Bad alert, because I am trying to logout.. I think this is getting launched by clearSession() in /00-login/app/index.js/

// line 45
   _onLogout = () => {
        auth0.webAuth
            .clearSession({})
            .then(success => {
                Alert.alert(
                    'Logged out!'
                );
                this.setState({ accessToken: null });
            })
            .catch(error => {
                console.log("Log out cancelled");
            });
    };
  • I did not test android.

Thanks for the sample app!

Cheers,
Peter


Attempt 1: Didn't work.

  1. I am following this React Native Quickstart

  2. I followed Auth0 instructions to create a new application within my tenant set up as a react-native app.

  3. I selected: Download the sample configured with my account settings.

  4. ran these commands:

$ npm install
 ... came back "found some vulnerabilites, you should run npm audit fix"
$ npm audit fix
... came back ok
$ react-native link react-native-auth0
 ... came back "already linked"
$ react-native run-ios
 ... problems begin

First time I tried to run in simulator, I saw this error:

ld: library not found for -lRCTGeolocation
clang: error: 
linker command failed with exit code 1 (use -v to see invocation)


** BUILD FAILED **


The following commands produced analyzer issues:
	Analyze /Users/peterweicher/code/00-login/node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp normal x86_64
	Analyze /Users/peterweicher/code/00-login/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal x86_64
(2 commands with analyzer issues)

The following build commands failed:
	Ld /Users/peterweicher/code/00-login/ios/build/Auth0Samples/Build/Products/Debug-iphonesimulator/Auth0Samples.app/Auth0Samples normal x86_64
(1 failure)

I googled a bit and someone said remove the relevant *.a file to see if run-ios could recreate it to find the library, so:

  • I opened /00-login/ios/Auth0Samples.xcodeproj
  • In TARGETS > Auth0Samples > Build Phases > Link Binary With Libraries:
    • I could not figure out how to delete the IibRTCGeoLocation.a file, so instead I went into the Xcode folder navigator to Auth0Samples > Libraries and deleted RTCGeoLocation.xcodeproj file to see if the library would uninstall. When I did this, the *.a file for RTCGeoLocation disappeared as well. NOTE: the libRTCGeoLocation.a file had a different icon next to it than the other libraries in "Link Binary With Libraries" ... it was a black circle instead of a white temple.

After deleting this library, I ran react-native run-ios again to see what would happen.

  • Simulator opened with "No Bundle URL Present" error.

I went back into /00-login and ran npm install again to see if I needed to recreate that library or something. No errors. Then I ran react-native run-ios again:

  • Simulator opened with "No Bundle URL Present" error.

NOTE: when I run the React-Native CLI Quickstart tutorial, a second terminal opens with the metro bundler on port 8081, which I assume is the node server or something. That never happens with this 00-login directory. I tried running npm start, and the metro bundler kicks off, but the CMD + R simulator reload still shows the "No Bundle URL Present" error.


Attempt 2!!

$ rm -r /00-login

Redownloaded folder and tried again.

$ npm install
... OK, skipping audit fix in case that caused problem
$ react-native link react-native-auth0
... came back "already linked"
$ react-native run-ios
... App builds and launches successfully, including separate terminal window for Metro Bundler! 
... Not sure why. Now time to fix callback url problems.

The end.

from auth0-react-native-sample.

madebyew avatar madebyew commented on June 8, 2024

I am also getting ‘Error: Missing NativeModule. Please make sure you run `react-native link react-native-auth0’. I too have tried linking the react-native-auth0, and also got a message saying, “react-native-auth0” is already linked.

from auth0-react-native-sample.

lbalmaceda avatar lbalmaceda commented on June 8, 2024

@madebyew What version of react-native sdk (not this lib) is your app running today?

from auth0-react-native-sample.

madebyew avatar madebyew commented on June 8, 2024

@lbalmaceda I'm using 0.61.2 (current latest).

from auth0-react-native-sample.

madebyew avatar madebyew commented on June 8, 2024

The following command resolved this for me:
cd ios && pod install && cd ..

from auth0-react-native-sample.

lbalmaceda avatar lbalmaceda commented on June 8, 2024

I'm glad you could solve it. That's part of the guidance for react native SDK 0.60 and above. I'm preparing the next release that includes all that.

from auth0-react-native-sample.

lbalmaceda avatar lbalmaceda commented on June 8, 2024

Samples were updated a few weeks ago, with the new version I mentioned above. If you happen to run into new issues, feel free to re-open this

from auth0-react-native-sample.

Related Issues (20)

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.