Comments (9)
Is there any update on this?
from auth0-react-native-sample.
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.
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.
-
I am following this React Native Quickstart
-
I followed Auth0 instructions to create a new application within my tenant set up as a react-native app.
-
I selected: Download the sample configured with my account settings.
-
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.
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.
@madebyew What version of react-native sdk (not this lib) is your app running today?
from auth0-react-native-sample.
@lbalmaceda I'm using 0.61.2 (current latest).
from auth0-react-native-sample.
The following command resolved this for me:
cd ios && pod install && cd ..
from auth0-react-native-sample.
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.
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)
- Unable to build the app on Android due to react-native-gradle-plugin:compileKotlin FAILURE HOT 1
- error: Error: Unable to resolve module ./auth0-configuration from auth0-react-native-sample/00-Login-Hooks/app/App.js: HOT 1
- docs are outdated HOT 1
- Can't run 00-Login app in Xcode 14.3 on M2 Mac HOT 1
- Some changes are needed to run the Hooks sample HOT 2
- Expo Router 2 example HOT 3
- The type initializer for 'System.Text.Json.JsonSerializer' threw an exception HOT 1
- Facing issues with `Sign in With Apple` HOT 4
- How to add forgot password in custom login
- pod install errors out HOT 5
- RN upgrades breaks build
- A0Auth0 pod not installed and linked to the sample app.
- A0Auth0 not installed and linked into app HOT 2
- Peer Dependency Conflict HOT 1
- Add a test for App.js HOT 2
- Invalid address from sample app HOT 7
- 00-Login-Expo - Support of Social login HOT 1
- `getCredentials` return undefined. HOT 4
- App doesn't start on scanning qr code on IOS HOT 2
- typescript HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auth0-react-native-sample.