mirror of
https://github.com/zhigang1992/react-native-wechat-1.git
synced 2026-01-12 17:43:04 +08:00
3949271c9f912a33c619831835d18bf5963a9f57
react-native-wechat
Getting started
$ npm install react-native-wechat --save
Mostly automatic installation
$ react-native link react-native-wechat
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-wechatand addRNWechat.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNWechat.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNWechatPackage;to the imports at the top of the file - Add
new RNWechatPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-wechat' project(':react-native-wechat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wechat/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-wechat')
Windows
- In Visual Studio add the
RNWechat.slninnode_modules/react-native-wechat/windows/RNWechat.slnfolder to their solution, reference from their app. - Open up your
MainPage.csapp
- Add
using Wechat.RNWechat;to the usings at the top of the file - Add
new RNWechatPackage()to theList<IReactPackage>returned by thePackagesmethod
Usage
import RNWechat from 'react-native-wechat';
// TODO: What to do with the module?
RNWechat;
Languages
Objective-C
64.1%
Java
18.6%
JavaScript
16.6%
Ruby
0.7%