友盟推送 React Native.
Getting Started
First, cd
to your RN project directory, and install RNMK through rnpm . If you don't have rnpm, you can install RNMK from npm with the command npm i -S tnrn-umeng-push
and link it manually (see below).
iOS
-
#### React Native < 0.46 (Using rnpm)
rnpm install tnrn-umeng-push
-
#### React Native >= 0.46
$npm install -S tnrn-umeng-push
$react-native link tnrn-umeng-push
Manually
- Add
node_modules/tnrn-umeng-push/ios/RNUMPush.xcodeproj
to your xcode project, usually under theLibraries
group - Add
libRNUMPush.a
(fromProducts
underRNUMPush.xcodeproj
) to build target'sLinked Frameworks and Libraries
list - Add ocr framework to
$(PROJECT_DIR)/Frameworks.
Android
-
#### React Native < 0.46 (Using rnpm)
rnpm install tnrn-umeng-push
-
#### React Native >= 0.46
$npm install -S tnrn-umeng-push
$react-native link tnrn-umeng-push
Manually
- JDK 7+ is required
- Add the following snippet to your
android/settings.gradle
:
include ':tnrn-umeng-push'project(':tnrn-umeng-push').projectDir = new File(rootProject.projectDir, '../node_modules/tnrn-umeng-push/android/app')
- Declare the dependency in your
android/app/build.gradle
dependencies { ... compile project(':tnrn-umeng-push')}
- Import
import io.tnrn.splashscreen.SplashScreenPackage;
and register it in yourMainActivity
(or equivalent, RN >= 0.32 MainApplication.java):
@Overrideprotected List<ReactPackage> { return Arrays.;}
Finally, you're good to go, feel free to require tnrn-umeng-push
in your JS files.
Have fun! 🤘
Basic Usage
Import library
import RNUMPush from 'tnrn-umeng-push'
Questions
made with ♥