Skip to content

Latest commit

Β 

History

History
98 lines (66 loc) Β· 2.47 KB

File metadata and controls

98 lines (66 loc) Β· 2.47 KB

✨ Magic React Native Demo Apps

This repository contains two mobile applications demonstrating Magic's React Native SDKs and extensions for both Bare React Native and Expo managed workflows.

πŸ”‘ Setup and Installation

  1. Get Magic API Keys: Sign up or login to the developer dashboard to receive API keys.

  2. Clone the Repository:

# SSH
$ git clone git@github.com:magiclabs/react-native-demo.git
# HTTPS
$ git clone https://github.com/magiclabs/react-native-demo.git
  1. Configure API Keys: Update the Magic publishable API key in both projects:
  • Bare React Native Example: MagicBareRnExample/hooks/magic.ts
  • Expo Example: MagicExpoRNExample/hooks/magic.ts

Replace 'YOUR_PUBLISHABLE_KEY' with your actual Magic publishable API key.

πŸ“± Expo Tutorial (Managed Workflow)

The Expo example uses Expo Router for navigation and includes modern React Native features.

$ cd MagicExpoRNExample
$ yarn install
$ yarn start

When the bundler starts:

  • Press i to open iOS simulator
  • Press a to open Android emulator
  • Press w to open in web browser

πŸ”§ Bare React Native Tutorial (Standalone Workflow)

The Bare React Native example provides full native control and custom configurations.

$ cd MagicBareRNExample
$ yarn install

iOS Setup

$ cd ios
$ pod install
$ cd ..
$ yarn ios

Android Setup

$ yarn android

🚨 Troubleshooting

Error code 65 (iOS Build Issues)

If you encounter Error code 65 when running yarn ios:

  1. Clean Build: Follow these steps to clean your iOS build.

  2. Update AppDelegate: If updating React Native versions, manually update the AppDelegate.mm file in Xcode as suggested here.

Pod Install Issues

If you encounter issues with pod install:

$ cd ios
$ pod install

Metro Cache Issues

Clear Metro cache if you encounter bundling issues:

$ yarn start --reset-cache

πŸ“š Additional Resources

πŸ“„ License

This project is licensed under the MIT License.