Skip to main content

React Native SDK Installation

Complete installation guide for the Resync React Native SDK.

Requirements

  • React Native v0.64 or higher
  • Node.js v16 or higher
  • iOS 12.0+ / Android 5.0+

Installation

Install the SDK

npm install resync-react-native

Or with yarn:

yarn add resync-react-native

Install Peer Dependencies

The SDK requires the following peer dependencies:

npm install react-native-svg lucide-react-native @react-native-async-storage/async-storage

Or with yarn:

yarn add react-native-svg lucide-react-native @react-native-async-storage/async-storage

Platform-Specific Setup

iOS Setup

If you're using React Native (not Expo), install iOS pods:

cd ios && pod install && cd ..

Android Setup

No additional setup required for Android!

Expo Setup

Resync works seamlessly with Expo. Use Expo's install command:

npx expo install resync-react-native react-native-svg @react-native-async-storage/async-storage

For Lucide icons:

npm install lucide-react-native

Initialization

Initialize Resync as early as possible in your app (typically in App.tsx or index.js):

import Resync from 'resync-react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';

Resync.init({
key: 'your-api-key',
appId: 7,
callback: async () => {
console.log('Resync initialized');
},
storage: AsyncStorage,
environment: 'production',
});

export default function App() {
return (
// Your app components
);
}

Verify Installation

Test that everything is working:

import { ResyncContentView } from 'resync-react-native';

export default function TestScreen() {
return (
<ResyncContentView name="TestContent" />
);
}

Troubleshooting

Pods Installation Failed (iOS)

Try cleaning and reinstalling:

cd ios
rm -rf Pods Podfile.lock
pod install
cd ..

Metro bundler issues

Clear Metro cache:

npx react-native start --reset-cache

Module not found errors

Ensure all peer dependencies are installed:

npm install react-native-svg lucide-react-native @react-native-async-storage/async-storage

Next Steps