diff --git a/privy-expo-bare-starter/.gitignore b/privy-expo-bare-starter/.gitignore deleted file mode 100644 index 05647d5..0000000 --- a/privy-expo-bare-starter/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files - -# dependencies -node_modules/ - -# Expo -.expo/ -dist/ -web-build/ - -# Native -*.orig.* -*.jks -*.p8 -*.p12 -*.key -*.mobileprovision - -# Metro -.metro-health-check* - -# debug -npm-debug.* -yarn-debug.* -yarn-error.* - -# macOS -.DS_Store -*.pem - -# local env files -.env*.local - -# typescript -*.tsbuildinfo diff --git a/privy-expo-bare-starter/README.md b/privy-expo-bare-starter/README.md deleted file mode 100644 index 78244cd..0000000 --- a/privy-expo-bare-starter/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Privy Expo Starter (bare) - -This demonstrates a minimal working installation of the privy sdk in an [bare](https://docs.expo.dev/bare/overview/) expo app. -We recommend reading the [documentation](https://docs.privy.io/basics/react-native/setup) for a more detailed guide. - -## Setup - -1. Install dependencies - - ```sh - yarn - ``` - -2. Configure an app client in your [Dashboard](https://dashboard.privy.io/apps?page=settings&setting=clients), and add your Privy app ID and app client ID in `app.json` - - ```json - ... - "extra": { - "privyAppId": "", - "privyClientId": "" - } - ... - ``` - -3. Configure your application identifier in `app.json`. This should match the bundle identifier for your app in the app store. - - ```json - ... - "ios": { - "bundleIdentifier": "com.example.myapp" - }, - "android": { - "package": "com.example.myapp" - } - ... - ``` - - Make sure to run `yarn expo prebuild` to update the native iOS and Android projects after doing so. - -4. If you are making use of passkeys, ensure that you have an [associated website](https://docs.privy.io/guide/expo/setup/passkey#_3-update-native-app-settings) for your application. Once you have this your `app.json` should be updated as follows: - - ```json - ... - "associatedDomains": ["webcredentials:"], - ... - "extra": { - ... - "passkeyAssociatedDomain": "https://" - }, - ... - ``` - - Make sure to run `yarn expo prebuild` to update the native iOS and Android projects after doing so. - -## Run the app - -```sh -# expo go -yarn run start - -# ios -yarn run ios - -# android -yarn run android -``` diff --git a/privy-expo-bare-starter/android/.gitignore b/privy-expo-bare-starter/android/.gitignore deleted file mode 100644 index 8a6be07..0000000 --- a/privy-expo-bare-starter/android/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# OSX -# -.DS_Store - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml -*.hprof -.cxx/ - -# Bundle artifacts -*.jsbundle diff --git a/privy-expo-bare-starter/android/app/src/debug/AndroidManifest.xml b/privy-expo-bare-starter/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 3ec2507..0000000 --- a/privy-expo-bare-starter/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/privy-expo-bare-starter/android/app/src/main/AndroidManifest.xml b/privy-expo-bare-starter/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 2412c5f..0000000 --- a/privy-expo-bare-starter/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/java/dev/privy/example/MainActivity.kt b/privy-expo-bare-starter/android/app/src/main/java/dev/privy/example/MainActivity.kt deleted file mode 100644 index c7be327..0000000 --- a/privy-expo-bare-starter/android/app/src/main/java/dev/privy/example/MainActivity.kt +++ /dev/null @@ -1,65 +0,0 @@ -package dev.privy.example -import expo.modules.splashscreen.SplashScreenManager - -import android.os.Build -import android.os.Bundle - -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled -import com.facebook.react.defaults.DefaultReactActivityDelegate - -import expo.modules.ReactActivityDelegateWrapper - -class MainActivity : ReactActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - // Set the theme to AppTheme BEFORE onCreate to support - // coloring the background, status bar, and navigation bar. - // This is required for expo-splash-screen. - // setTheme(R.style.AppTheme); - // @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af - SplashScreenManager.registerOnActivity(this) - // @generated end expo-splashscreen - super.onCreate(null) - } - - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun getMainComponentName(): String = "main" - - /** - * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] - * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] - */ - override fun createReactActivityDelegate(): ReactActivityDelegate { - return ReactActivityDelegateWrapper( - this, - BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, - object : DefaultReactActivityDelegate( - this, - mainComponentName, - fabricEnabled - ){}) - } - - /** - * Align the back button behavior with Android S - * where moving root activities to background instead of finishing activities. - * @see onBackPressed - */ - override fun invokeDefaultOnBackPressed() { - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) { - if (!moveTaskToBack(false)) { - // For non-root activities, use the default implementation to finish them. - super.invokeDefaultOnBackPressed() - } - return - } - - // Use the default back button implementation on Android S - // because it's doing more than [Activity.moveTaskToBack] in fact. - super.invokeDefaultOnBackPressed() - } -} diff --git a/privy-expo-bare-starter/android/app/src/main/java/dev/privy/example/MainApplication.kt b/privy-expo-bare-starter/android/app/src/main/java/dev/privy/example/MainApplication.kt deleted file mode 100644 index 5bfc39b..0000000 --- a/privy-expo-bare-starter/android/app/src/main/java/dev/privy/example/MainApplication.kt +++ /dev/null @@ -1,57 +0,0 @@ -package dev.privy.example - -import android.app.Application -import android.content.res.Configuration - -import com.facebook.react.PackageList -import com.facebook.react.ReactApplication -import com.facebook.react.ReactNativeHost -import com.facebook.react.ReactPackage -import com.facebook.react.ReactHost -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load -import com.facebook.react.defaults.DefaultReactNativeHost -import com.facebook.react.soloader.OpenSourceMergedSoMapping -import com.facebook.soloader.SoLoader - -import expo.modules.ApplicationLifecycleDispatcher -import expo.modules.ReactNativeHostWrapper - -class MainApplication : Application(), ReactApplication { - - override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper( - this, - object : DefaultReactNativeHost(this) { - override fun getPackages(): List { - val packages = PackageList(this).packages - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(MyReactNativePackage()) - return packages - } - - override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry" - - override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG - - override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED - override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED - } - ) - - override val reactHost: ReactHost - get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost) - - override fun onCreate() { - super.onCreate() - SoLoader.init(this, OpenSourceMergedSoMapping) - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - load() - } - ApplicationLifecycleDispatcher.onApplicationCreate(this) - } - - override fun onConfigurationChanged(newConfig: Configuration) { - super.onConfigurationChanged(newConfig) - ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig) - } -} diff --git a/privy-expo-bare-starter/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png b/privy-expo-bare-starter/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png deleted file mode 100644 index 0908137..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png b/privy-expo-bare-starter/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png deleted file mode 100644 index ac8a5bb..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png b/privy-expo-bare-starter/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png deleted file mode 100644 index cec3361..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png b/privy-expo-bare-starter/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png deleted file mode 100644 index 6c08a11..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png b/privy-expo-bare-starter/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png deleted file mode 100644 index fbe261e..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/drawable/ic_launcher_background.xml b/privy-expo-bare-starter/android/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 883b2a0..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/privy-expo-bare-starter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 3941bea..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/privy-expo-bare-starter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 3941bea..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index 7fae0cc..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp deleted file mode 100644 index ac03dbf..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index afa0a4e..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 78aaf45..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp deleted file mode 100644 index e1173a9..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp deleted file mode 100644 index c4f6e10..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index 7a0f085..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp deleted file mode 100644 index ff086fd..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index 6c2d40b..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index 730e3fa..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp deleted file mode 100644 index f7f1d06..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp deleted file mode 100644 index 3452615..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index b11a322..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp deleted file mode 100644 index 49a464e..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp deleted file mode 100644 index b51fd15..0000000 Binary files a/privy-expo-bare-starter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/privy-expo-bare-starter/android/app/src/main/res/values-night/colors.xml b/privy-expo-bare-starter/android/app/src/main/res/values-night/colors.xml deleted file mode 100644 index 3c05de5..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/values-night/colors.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/res/values/colors.xml b/privy-expo-bare-starter/android/app/src/main/res/values/colors.xml deleted file mode 100644 index f387b90..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - #ffffff - #ffffff - #023c69 - #ffffff - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/res/values/strings.xml b/privy-expo-bare-starter/android/app/src/main/res/values/strings.xml deleted file mode 100644 index b22404d..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - \@privy-io/expo-bare-starter - contain - false - automatic - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/app/src/main/res/values/styles.xml b/privy-expo-bare-starter/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 3e5d436..0000000 --- a/privy-expo-bare-starter/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - \ No newline at end of file diff --git a/privy-expo-bare-starter/android/build.gradle b/privy-expo-bare-starter/android/build.gradle deleted file mode 100644 index fa7b11e..0000000 --- a/privy-expo-bare-starter/android/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath('com.android.tools.build:gradle') - classpath('com.facebook.react:react-native-gradle-plugin') - classpath('org.jetbrains.kotlin:kotlin-gradle-plugin') - } -} - -def reactNativeAndroidDir = new File( - providers.exec { - workingDir(rootDir) - commandLine("node", "--print", "require.resolve('react-native/package.json')") - }.standardOutput.asText.get().trim(), - "../android" -) - -allprojects { - repositories { - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url(reactNativeAndroidDir) - } - - google() - mavenCentral() - maven { url 'https://www.jitpack.io' } - } -} - -apply plugin: "expo-root-project" -apply plugin: "com.facebook.react.rootproject" diff --git a/privy-expo-bare-starter/android/gradle/wrapper/gradle-wrapper.jar b/privy-expo-bare-starter/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index a4b76b9..0000000 Binary files a/privy-expo-bare-starter/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/privy-expo-bare-starter/android/settings.gradle b/privy-expo-bare-starter/android/settings.gradle deleted file mode 100644 index d169bea..0000000 --- a/privy-expo-bare-starter/android/settings.gradle +++ /dev/null @@ -1,39 +0,0 @@ -pluginManagement { - def reactNativeGradlePlugin = new File( - providers.exec { - workingDir(rootDir) - commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })") - }.standardOutput.asText.get().trim() - ).getParentFile().absolutePath - includeBuild(reactNativeGradlePlugin) - - def expoPluginsPath = new File( - providers.exec { - workingDir(rootDir) - commandLine("node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })") - }.standardOutput.asText.get().trim(), - "../android/expo-gradle-plugin" - ).absolutePath - includeBuild(expoPluginsPath) -} - -plugins { - id("com.facebook.react.settings") - id("expo-autolinking-settings") -} - -extensions.configure(com.facebook.react.ReactSettingsExtension) { ex -> - if (System.getenv('EXPO_USE_COMMUNITY_AUTOLINKING') == '1') { - ex.autolinkLibrariesFromCommand() - } else { - ex.autolinkLibrariesFromCommand(expoAutolinking.rnConfigCommand) - } -} -expoAutolinking.useExpoModules() - -rootProject.name = '@privy-ioexpo-bare-starter' - -expoAutolinking.useExpoVersionCatalog() - -include ':app' -includeBuild(expoAutolinking.reactNativeGradlePlugin) diff --git a/privy-expo-bare-starter/app.json b/privy-expo-bare-starter/app.json deleted file mode 100644 index ab81b84..0000000 --- a/privy-expo-bare-starter/app.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "expo": { - "name": "@privy-io/expo-bare-starter", - "slug": "expo-bare-starter", - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/images/icon.png", - "scheme": "myapp", - "userInterfaceStyle": "automatic", - "splash": { - "image": "./assets/images/splash.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "ios": { - "usesAppleSignIn": true, - "supportsTablet": true, - "bundleIdentifier": "dev.privy.example", - "associatedDomains": ["webcredentials:"], - "infoPlist": { - "NSAppTransportSecurity": { - "NSAllowsArbitraryLoads": true - } - } - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/images/adaptive-icon.png", - "backgroundColor": "#ffffff" - }, - "package": "dev.privy.example" - }, - "extra": { - "privyAppId": "", - "privyClientId": "", - "passkeyAssociatedDomain": "https://" - }, - "plugins": [ - "expo-router", - "expo-secure-store", - "expo-apple-authentication", - [ - "expo-build-properties", - { - "ios": { - "deploymentTarget": "17.5" - }, - "android": { - "compileSdkVersion": 35 - } - } - ], - "expo-font" - ], - "experiments": { - "typedRoutes": true - } - } -} diff --git a/privy-expo-bare-starter/app/_layout.tsx b/privy-expo-bare-starter/app/_layout.tsx deleted file mode 100644 index e93e7bf..0000000 --- a/privy-expo-bare-starter/app/_layout.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import Constants from "expo-constants"; -import { Stack } from "expo-router"; -import { PrivyProvider } from "@privy-io/expo"; -import { PrivyElements } from "@privy-io/expo/ui"; -import { - Inter_400Regular, - Inter_500Medium, - Inter_600SemiBold, -} from "@expo-google-fonts/inter"; -import { useFonts } from "expo-font"; - -export default function RootLayout() { - useFonts({ - Inter_400Regular, - Inter_500Medium, - Inter_600SemiBold, - }); - return ( - - - - - - - ); -} diff --git a/privy-expo-bare-starter/app/index.tsx b/privy-expo-bare-starter/app/index.tsx deleted file mode 100644 index 01f0787..0000000 --- a/privy-expo-bare-starter/app/index.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { SafeAreaView, Text, View } from "react-native"; -import Constants from "expo-constants"; -import LoginScreen from "@/components/LoginScreen"; -import { usePrivy } from "@privy-io/expo"; -import { UserScreen } from "@/components/UserScreen"; - -export default function Index() { - const { user } = usePrivy(); - if ((Constants.expoConfig?.extra?.privyAppId as string).length !== 25) { - return ( - - - You have not set a valid `privyAppId` in app.json - - - ); - } - if ( - !(Constants.expoConfig?.extra?.privyClientId as string).startsWith( - "client-" - ) - ) { - return ( - - - You have not set a valid `privyClientId` in app.json - - - ); - } - return !user ? : ; -} diff --git a/privy-expo-bare-starter/assets/images/adaptive-icon.png b/privy-expo-bare-starter/assets/images/adaptive-icon.png deleted file mode 100644 index 03d6f6b..0000000 Binary files a/privy-expo-bare-starter/assets/images/adaptive-icon.png and /dev/null differ diff --git a/privy-expo-bare-starter/assets/images/favicon.png b/privy-expo-bare-starter/assets/images/favicon.png deleted file mode 100644 index e75f697..0000000 Binary files a/privy-expo-bare-starter/assets/images/favicon.png and /dev/null differ diff --git a/privy-expo-bare-starter/assets/images/icon.png b/privy-expo-bare-starter/assets/images/icon.png deleted file mode 100644 index a0b1526..0000000 Binary files a/privy-expo-bare-starter/assets/images/icon.png and /dev/null differ diff --git a/privy-expo-bare-starter/assets/images/splash.png b/privy-expo-bare-starter/assets/images/splash.png deleted file mode 100644 index 0e89705..0000000 Binary files a/privy-expo-bare-starter/assets/images/splash.png and /dev/null differ diff --git a/privy-expo-bare-starter/babel.config.js b/privy-expo-bare-starter/babel.config.js deleted file mode 100644 index 9d89e13..0000000 --- a/privy-expo-bare-starter/babel.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = function (api) { - api.cache(true); - return { - presets: ['babel-preset-expo'], - }; -}; diff --git a/privy-expo-bare-starter/components/LoginScreen.tsx b/privy-expo-bare-starter/components/LoginScreen.tsx deleted file mode 100644 index 60c50bb..0000000 --- a/privy-expo-bare-starter/components/LoginScreen.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { Button, Linking, Text, View } from "react-native"; -import { LoginWithOAuthInput, useLoginWithOAuth } from "@privy-io/expo"; -import { useLogin } from "@privy-io/expo/ui"; -import { useLoginWithPasskey } from "@privy-io/expo/passkey"; -import Constants from "expo-constants"; -import { useState } from "react"; -import * as Application from "expo-application"; - -export default function LoginScreen() { - const [error, setError] = useState(""); - const { loginWithPasskey } = useLoginWithPasskey({ - onError: (err) => { - console.log(err); - setError(JSON.stringify(err.message)); - }, - }); - const { login } = useLogin(); - const oauth = useLoginWithOAuth({ - onError: (err) => { - console.log(err); - setError(JSON.stringify(err.message)); - }, - }); - return ( - - Privy App ID: - - {Constants.expoConfig?.extra?.privyAppId} - - Privy Client ID: - - {Constants.expoConfig?.extra?.privyClientId} - - - Navigate to your{" "} - - Linking.openURL( - `https://dashboard.privy.io/apps/${Constants.expoConfig?.extra?.privyAppId}/settings?setting=clients` - ) - } - > - dashboard - {" "} - and ensure the following Expo Application ID is listed as an `Allowed - app identifier`: - - {Application.applicationId} - - Navigate to your{" "} - - Linking.openURL( - `https://dashboard.privy.io/apps/${Constants.expoConfig?.extra?.privyAppId}/settings?setting=clients` - ) - } - > - dashboard - {" "} - and ensure the following value is listed as an `Allowed app URL scheme`: - - - {Application.applicationId === "host.exp.Exponent" - ? "exp" - : Constants.expoConfig?.scheme} - - - - - ))} - - {error && Error: {error}} - - ); -} diff --git a/privy-expo-bare-starter/components/UserScreen.tsx b/privy-expo-bare-starter/components/UserScreen.tsx deleted file mode 100644 index 1acbe25..0000000 --- a/privy-expo-bare-starter/components/UserScreen.tsx +++ /dev/null @@ -1,195 +0,0 @@ -import React, { useState, useCallback } from "react"; -import { Text, TextInput, View, Button, ScrollView } from "react-native"; - -import { - usePrivy, - useEmbeddedEthereumWallet, - getUserEmbeddedEthereumWallet, - PrivyEmbeddedWalletProvider, - useLinkWithOAuth, -} from "@privy-io/expo"; -import Constants from "expo-constants"; -import { useLinkWithPasskey } from "@privy-io/expo/passkey"; -import { PrivyUser } from "@privy-io/public-api"; - -const toMainIdentifier = (x: PrivyUser["linked_accounts"][number]) => { - if (x.type === "phone") { - return x.phoneNumber; - } - if (x.type === "email" || x.type === "wallet") { - return x.address; - } - - if (x.type === "twitter_oauth" || x.type === "tiktok_oauth") { - return x.username; - } - - if (x.type === "custom_auth") { - return x.custom_user_id; - } - - return x.type; -}; - -export const UserScreen = () => { - const [chainId, setChainId] = useState("1"); - const [signedMessages, setSignedMessages] = useState([]); - - const { logout, user } = usePrivy(); - const { linkWithPasskey } = useLinkWithPasskey(); - const oauth = useLinkWithOAuth(); - const { wallets, create } = useEmbeddedEthereumWallet(); - const account = getUserEmbeddedEthereumWallet(user); - - const signMessage = useCallback( - async (provider: PrivyEmbeddedWalletProvider) => { - try { - const message = await provider.request({ - method: "personal_sign", - params: [`0x0${Date.now()}`, account?.address], - }); - if (message) { - setSignedMessages((prev) => prev.concat(message)); - } - } catch (e) { - console.error(e); - } - }, - [account?.address] - ); - - const switchChain = useCallback( - async (provider: PrivyEmbeddedWalletProvider, id: string) => { - try { - await provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: id }], - }); - alert(`Chain switched to ${id} successfully`); - } catch (e) { - console.error(e); - } - }, - [account?.address] - ); - - if (!user) { - return null; - } - - return ( - - - - ))} - - - - - - User ID - {user.id} - - - - Linked accounts - {user?.linked_accounts.length ? ( - - {user?.linked_accounts?.map((m, index) => ( - - {m.type}: {toMainIdentifier(m)} - - ))} - - ) : null} - - - - {account?.address && ( - <> - Embedded Wallet - {account?.address} - - )} - -