This is a simple Android application that demonstrates how to implement push notifications using the Courier Android SDK. The app allows you to send push notifications to devices using Firebase Cloud Messaging (FCM) as the push notification provider.
- Android Studio
- Firebase Cloud Messaging (FCM) setup (instructions provided below)
To get started with the Android Push Notification App, follow these steps:
- Clone this repository to your local machine.
- Open the project in Android Studio.
- Install the required packages by running the following command in the terminal:
./gradlew build
- Go into MyApplication.kt, replace
YOUR_AUTH_KEY
with your auth key andYOUR_COURIER_ID
with the appropriate id.
This will download and install all the necessary dependencies for the project (including the Courier Android SDK 2.0.2).
Before you can send push notifications using this app, you need to set up Firebase Cloud Messaging (FCM) and link it with your Courier dashboard. Here's how you can do it:
- Go to the Firebase Console.
- Create a new project and follow the instructions to set up FCM for Android. Make sure to follow the steps to implement the SDK into the project.
- Once you've set up FCM, go to the Courier Dashboard.
- Create a new provider and select Firebase Cloud Messaging (FCM) as the provider type.
- Copy the FCM server key from your Firebase project settings and paste it into the provider configuration in the Courier Dashboard.
To send push notifications using this app, follow these steps:
- Run the app on an Android device (a physical device is recommended as Courier does not support the emulator).
- Make sure you have granted the necessary permissions for push notifications.
- Click the "Send Notification" button to trigger a test push notification.