SendBird React-Native sample using SendBird SDK.
- Node
- NPM
- Cocoapods
- XCode
- XCode Command Line Tools
- Android Studio (+Android SDK/Google API)
-
Install React Native CLI.
npm install -g react-native-cli -
Install required packages.
npm install -
(iOS only) Pod install.
cd ios pod install -
(iOS only) Add library in XCode
- Open XCode and load workspace
- Right click to 'Libraries' > Add Files to "Project Name" > select
node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj - Right click to 'Libraries' > Add Files to "Project Name" > select
node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj - Project Settings > Build Phases > Link Binary With Libraries > Add
libRCTPushNotification.a - Project Settings > Build Phases > Link Binary With Libraries > Add
libRNGestureHandler.a - Project Settings > Build Phases > Link Binary With Libraries > Add
JavaScriptCore.framework
-
Run the sample. Before starting, you should launch device amulator (or actual device) to run the sample in Android. This sample is not available for real device in iOS due to Apple Development Policy. In order to run React Native sample in real device, follow React Native official guide for your own setup.
react-native run-android react-native run-ios
If you see an error like this: "Unable to load script from assets index.android.bundle."
- (in project directory) mkdir android/app/src/main/assets
- react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
If you see an error like this: "Loading dependency graph...(node:45456) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: react-native"
- Try to delete ios/Pods file