rn-pushe
v1.0.3
Published
## Getting started
Downloads
8
Readme
rn-pushe
Getting started
$ npm install rn-pushe --save
Mostly automatic installation
$ react-native link rn-pushe
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜rn-pushe
and addRNReactNativePushe.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativePushe.a
to 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.RNReactNativePushePackage;
to the imports at the top of the file - Add
new RNReactNativePushePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':rn-pushe' project(':rn-pushe').projectDir = new File(rootProject.projectDir, '../node_modules/rn-pushe/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':rn-pushe')
Windows
- In Visual Studio add the
RNReactNativePushe.sln
innode_modules/rn-pushe/windows/RNReactNativePushe.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using React.Native.Pushe.RNReactNativePushe;
to the usings at the top of the file - Add
new RNReactNativePushePackage()
to theList<IReactPackage>
returned by thePackages
method
Usage
import Pushe from "rn-pushe";
// TODO: What to do with the module?
pushe.initialize(false);
// return pushe id
try {
console.log(await pushe.getPusheId());
} catch {}
// return true if Pushe is Initialized
try {
console.log(await pushe.isPusheInitialized());
} catch {}