pushbots-react-native
React Native Library for PushBots Push Notifications Service.
Getting started
npm install pushbots-react-native --save && npm install
Automatic Installation
react-native link pushbots-react-native
Configuration
iOS
Add Required Capabilities
- Select the root project and then under Capabilities click to enable "Push Notifications".
- Enable "Background Modes" and check "Remote notifications".
Adding the Code
- Open
AppDelegate.h
Import RCTPushbots:
- The add PushbotsClient propery below
@property (nonatomic, strong) UIWindow *window;
- Open
AppDelegate.m
: Add PushBots code toapplication:didFinishLaunchingWithOptions
method (replace APP_ID with your PushBots app ID):
Android
Go to android/app/build.gradle
app level and add this in default config
Add the following to defaultConfig in build.gradle
file inside the android/app folder
Update buildToolsVersion and compileSdkVersion to 27
Update com.android.support
to 27 in dependencies
Open android/build.gradle
, Add google repo to allprojects in maven section
Usage
in your App.js: