• X6_484534
  • 3.6MB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-05-25 05:55
随Expo 37进行了更新。 以Auth0登录和获取数据为例。 带有页眉和抽屉的React-Navigation 5堆栈。 使用世博功能: 有趣的mainAppState reducer解决方案。 本地化i18n。 世博字体。 启动画面。 深度链接到外部应用程序的示例。 您可以在此处找到有关如何深入链接到您的应用的示例: 世博WebView。 带有Cookie共享的Expo Web in-app-modal。 auth0-示例 感谢两年前创建原始存储库的 。 它目前尚未维护,无法升级到新的Expo版本。 设置 在上创建自己的应用程序客户端。 在应用程序设置中,您必须为来自AuthSession模块(Expo中内置)的Expo应用程序添加重定向URL 。 URL的结构为: https://auth.expo.io/@your-username/your-expo-a
- Updated with Expo 37. - With examples of Auth0 login and fetching data. - React-Navigation 5 stack with Header, and drawer. - Using Expo features: - Interesting mainAppState reducer soulution. - Localization i18n. - Expo Fonts. - Splash screen. - Examples of deep linking to external apps. - You can find example of how to deep link to your app here: - Expo WebView. - Expo Web in-app-modal with cookies share. # auth0-example Credits to https://github.com/expo/auth0-example for creating the original repo two years ago. It is currently not maintained and cannot be upgraded to new Expo versions. ## Setup * Create your own application client on [Auth0](https://auth0.com). * In the application settings, you must add the **redirect URL** for your Expo application that is coming from the `AuthSession` module (built-in in Expo). The structure of the URL is: `https://auth.expo.io/@your-username/your-expo-app-slug` Your Expo app slug can be found in the [app.json](app.json) file. You can get the full redirect URL by simply logging `AuthSession.getRedirectUrl()` in your own codebase. ## Managing Secrets Expo Auth0 Create a env.ts file on the ./config directory, with `auth0ClientId` and `auth0Domain` values from your Auth0 application. (env.ts is already on the .gitignore file) ![Application Settings](images/image-1.jpeg) #./config/env.ts ``` const Env = { dev: { apiUrl: localhost, auth0ClientId: '*****', auth0Domain: '*****', }, staging: { apiUrl: "[your.staging.api.here]", }, prod: { apiUrl: "[your.production.api.here]", } }; export default Env; ``` ________________________ # Install & Run If you are using NPM: ``` npm install npm start ``` If you are using yarn: ``` yarn install yarn start ``` # Expo expo build:ios --release-channel staging expo build:android --release-channel staging expo publish --release-channel staging