Integrate Pushwoosh Android SDK
Follow the steps below to get your Android application ready to receive pushes

Requirements

Integration

1. Include the following Maven repository URL in project's build.gradle:
build.gradle
1
allprojects {
2
repositories {
3
google ()
4
mavenCentral()
5
}
6
}
Copied!
2. Add pushwoosh library dependencies into your application's build.gradle:
build.gradle
1
implementation 'com.pushwoosh:pushwoosh-firebase:6.+'
Copied!
Replace "+" with the current version of Pushwoosh and Android Support libraries.
3. Open your project in Android Studio. Go Tools > Firebase > Cloud Messaging and click "Set up Firebase Cloud Messaging":
4. Connect your app with Firebase, grant Android Studio access to your Google account (if needed), and choose your Firebase project.
5. Add FCM to your application and accept changes:
6. Add the following metadata to AndroidManifest.xml:
AndroidManifest.xml
1
<meta-data android:name="com.pushwoosh.appid" android:value="XXXXX-XXXXX" />
2
<meta-data android:name="com.pushwoosh.senderid" android:value="@string/fcm_sender_id" />
Copied!
Please note that you must add meta-data inside the <application> tag
Where:
  • com.pushwoosh.appid is your Pushwoosh Application Code
  • com.pushwoosh.senderid is the Sender ID you received from Firebase Console
Please note that you need to add fcm_sender_id to res/values/strings.xml of your Android project:
string.xml
1
<resources>
2
<string name="fcm_sender_id">123456789012</string>
3
</resources>
Copied!
7. Register for push notifications:
1
Pushwoosh.getInstance().registerForPushNotifications()
Copied!

Next steps

Last modified 19d ago