1.0.0 • Published 5 years ago
osw-react-native-baidu-push v1.0.0
react-native-native-baidu-push-library
Getting started
$ npm install react-native-native-baidu-push-library --save
Mostly automatic installation
$ react-native link react-native-native-baidu-push-library
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-native-baidu-push-libraryand addRNNativeBaiduPushLibrary.xcodeproj
- In XCode, in the project navigator, select your project. Add libRNNativeBaiduPushLibrary.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.RNNativeBaiduPushLibraryPackage;to the imports at the top of the file
- Add new RNNativeBaiduPushLibraryPackage()to the list returned by thegetPackages()method
- Append the following lines to android/settings.gradle:include ':react-native-native-baidu-push-library' project(':react-native-native-baidu-push-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-native-baidu-push-library/android')
- Insert the following lines inside the dependencies block in android/app/build.gradle:compile project(':react-native-native-baidu-push-library')
Windows
- In Visual Studio add the RNNativeBaiduPushLibrary.slninnode_modules/react-native-native-baidu-push-library/windows/RNNativeBaiduPushLibrary.slnfolder to their solution, reference from their app.
- Open up your MainPage.csapp
- Add using Native.Baidu.Push.Library.RNNativeBaiduPushLibrary;to the usings at the top of the file
- Add new RNNativeBaiduPushLibraryPackage()to theList<IReactPackage>returned by thePackagesmethod
Usage
import RNNativeBaiduPushLibrary from 'react-native-native-baidu-push-library';
// TODO: What to do with the module?
RNNativeBaiduPushLibrary;1.0.0
5 years ago