ReactNative
Development environment requirements
TypeScript
Node (Official Node.js LTS version 16.17.0 recommended)
npm (please match the version of node)
Step 1: Environment Construction
Please refer to React Naitve official documentation to set up a local development environment.
Step 2: Download and Import TUIKit
This project is React Native Chat Demo, which is a demo project developed by react-native-tim-js and community-related open source packages, which can help you quickly develop an instant messaging chat scene application.
git clone https://github.com/TencentCloud/chat-demo-react-native.git
Step 3: Dependency Installation
Execute the following code in the root directory of the project to install the dependencies required by the project.
// yarnyarn// npmnpm install// ioscd iospod install
Step 4: Run Demo
1. Please refer to the official document to prepare
SDKAppID
and UserSig
, you must have the correct SDKAppID before initialization.2. Fill the prepared
SDKAppID
and UserSig
into the src/pages/config.ts
file.3. Execute the following command to run demo:
// yarnyarn androidyarn ios// npmnpm run androidnpm run ios
Q&A
How to migrate to existing projects?
src/TUIKit
contains TUIChat and other related components, which can be directly copied to your project. At the same time, you also need to install the corresponding dependencies. For the corresponding dependencies, see the package.json
file.How to use it in expo project?
In
expo
, if the package you use contains native code, you need to use development build
. For details, please refer to the official documentation.How to install Expo modules in the demo
Android project error Task :react-native-create-thumbnail:compileDebugJavaWithJavac FAILED?
Project error No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi?
How to solve the project error Xxx is not Fabric compatible yet?
Find the suggested component and replace it with a native component.
How to solve the project error Undefined symbols for architecture x86_64?
How to solve the project error Execution failed for task ':react-native-gesture-handler:buildCMakeDebug[arm64-v8a]'?
Project error This declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)' ?
Project error could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; how to solve it?
App crashes, what's the problem?
Please check whether the permission is applied.
No response when you click to take a photo?
For the camera function, please use a real device to debug.
Communication and Feedback
- Development environment requirements
- Step 1: Environment Construction
- Step 2: Download and Import TUIKit
- Step 3: Dependency Installation
- Step 4: Run Demo
- QA
- How to migrate to existing projects?
- How to use it in expo project?
- How to install Expo modules in the demo
- Android project error Task :react-native-create-thumbnail:compileDebugJavaWithJavac FAILED?
- Project error No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi?
- How to solve the project error Xxx is not Fabric compatible yet?
- How to solve the project error Undefined symbols for architecture x86_64?
- How to solve the project error Execution failed for task ':react-native-gesture-handler:buildCMakeDebug[arm64-v8a]'?
- Project error This declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)' ?
- Project error could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; how to solve it?
- App crashes, what's the problem?
- No response when you click to take a photo?
- Communication and Feedback