Skip to content

Quick start

Get started with the Pushwoosh Android SDK using this quick and simple example

Prerequisites

To integrate the Pushwoosh Android SDK into your app, you will need the following:

Download the example project

Clone the example project from GitHub:

Terminal window
git clone https://github.com/Pushwoosh/pushwoosh-android-sample

Configure the project

  1. Place your google-services.json file in the pushwoosh-demoapp/app directory.

  2. In your build.gradle (Module: app), update the applicationId to match your package name.

  3. In res/values/strings.xml, set your project number as the value for fcm_sender_id and your Pushwoosh App Code as the value for pushwoosh_app_id:

<resources>
<string name="app_name">demoapp</string>
<string name="title_home">Actions</string>
<string name="title_notifications">Settings</string>
<string name="pushwoosh_app_id">_YOUR_PUSHWOOSH_APP_ID_</string>
<string name="fcm_sender_id">_YOUR_FIREBASE_PROJECT_ID_</string>
</resources>

Run the project

  1. Build and run the project.
  2. The app will have two tabs: “Actions” and “Settings”. Navigate to the Settings tab.
  3. Tap the Register for Pushes button.
  4. Grant permission for push notifications. The device will be registered with Pushwoosh.

You should see a log entry like this:

Terminal window
FirebaseApp initialization successful
Log level: INFO
Pushwoosh SDK initialized successfully
HWID: acf11f23-170d-4e65-8575-319b2795f8c3
APP_CODE: _YOUR_PUSHWOOSH_APP_ID_
PUSHWOOSH_SDK_VERSION: 6.7.18
FIREBASE_PROJECT_ID: _YOUR_FIREBASE_PROJECT_ID_
PUSH_TOKEN: cjdy....rk0Q
[DeviceRegistrar] Registered for push notifications: cjdy....rk0Q

Send a push notification

Go back to the Pushwoosh Control Panel and send a push notification to your registered device.

What’s next

To learn more, please refer to the basic integration guide