SDK: Kotlin / Java
Last updated
Last updated
Before you can integrate the SDK with your app the following requirements must be met:
Android device or emulator running API 19+ (Android 4.4) with Google Play Store Services installed.
An app that uses
Firebase Sender ID and Server API Key or Service Account. If you do not already have these follow to generate them.
SDK Key: Obtained from the Pushly Platform in the Domain Settings
page under the Overview
> Details
> Domain Information
section.
This guide assumes that you have already in your application and have also set up a MainApplication class and linked it in your AndroidManifest.xml's <application>
tag.
Add the following to the dependencies
section of your app/build.gradle
file:
Add the following import
to your app's main Application
class:
And then add the following lines inside of the onCreate
method.
Replace the REPLACE_WITH_SDK_KEY
in the setConfiguration
method with the SDK Key from the platform settings page.
Run your app on an Android device or emulator (ensuring the emulator has Google Play Store Services
installed) to make sure it builds correctly.
After accepting the dialog, log into the platform and navigate to Notifications > Create Notification
and send your first notification, targeting the Native: Android channel, to your device.
Once you have confirmed the SDK is working properly you may continue to add additional optional functionality like:
The code you added in the previous step will show the push permission dialog upon app open. This can be customized by using to control when the dialog shows.