PushBots Android SDK setup guide.
PushBots is a push notification service that help you manage notifications on all platforms (Android, iOS, Web, react-native, cordova) efficiently and easily.
A PushBots account
You will find APP_ID while integrating your project with dashboard
An API-KEY and SENDER-ID from FCM (Firebase notification messaging)
implementation 'com.pushbots:pushbots-lib:3.3.0@aar'
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'Add to defaultConfig section, then replace PUSHBOTS_APP_ID and GOOGLE_SENDER_ID
defaultConfig {
// Add PushBots integration data
manifestPlaceholders = [
pushbots_app_id : "YOUR_APP_ID",
pushbots_loglevel : "DEBUG",
google_sender_id : "YOUR_SENDER_ID"
]
}PushBots should be initialized when app just started, one of the existing ways is to initialize it in our application.
importandroid.app.Applicationimportcom.pushbots.push.PushbotsclassMyApplication : Application() {
overridefunonCreate() {
super.onCreate()
// Initialize Pushbots LibraryPushbots.sharedInstance().init(this)
}
}Now add your Application to Manifest.xml
<applicationandroid:name=".MyApplication">
</application>Now you have initialized PushBots successfully, BUT there is one more step to be able to receive notifications.
You need to register for it (You may register for it inside you MyApplication.class or MainActivity.class):
//Register for Push NotificationsPushbots.sharedInstance().registerForRemoteNotifications()Using the plugins DSL
plugins {
id "com.pushbots.android.plugin.pushbots-gradle-plugin" version "1.0-SNAPSHOT"
}Using legacy plugin application:
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
// Inside your app.build.gradle
dependencies {
classpath "gradle.plugin.com.pushbots:pushbots-gradle-plugin:1.0-SNAPSHOT"
}
}
apply plugin: "com.pushbots.android.plugin.pushbots-gradle-plugin"

