Skip to content
Go to file


Failed to load latest commit information.
Latest commit message
Commit time


A library to easily send notifications over Firebase Cloud Messaging (FCM). The library was built with the purpose of making the process of sending messages as simple and modular as posible.

Legacy API

FCM has had a total makeover for the new "REST v1 API". I have decided not to include backwards compatibility in Pushraven.
If you wish to use the (simpler) legacy API see Legacy Instructions

How to use Pushraven

0. Import Pushraven to your Project.

NOTE: New package name to remove redundant 'pushraven' in groupId!
Add Pushraven.jar and it's dependencies to your project. Or add Pushraven as a dependency:



compile group: 'us.raudi', name: 'pushraven', version: '1.0.3'

1. Give Pushraven your Project ID and your Service Account

Both of these can be found in your Firebase console, under Project Settings:

  • The ID is found in the "General" tab
  • The Service Account JSON file can be downloaded from the "Service Account" tab.
Pushraven.setCredential(new File("service_account.json"));	

**NOTE: ** A GoogleCredential object may also be used to set the credential.

2. Build your 'Message' using parameters from the FCM reference[1]

In Pushraven all the JSON Objects from the API are implemented as classes, and all fields are implemented as methods.

2.1 Create Notification

Notification not = new Notification()
		.title("Hello World")
		.body("This is a notification");

2.2 (Optional) Create target specific configurations.

AndroidConfig droidCfg = new AndroidConfig()
				new AndroidNotification()

2.3 Create the Message (using Notification and any configs)

Message raven = new Message()
		.token(CLIENT_ID) // could instead use: topic(String) or condition(String)
NOTE: Missing attributes

The FCM API may update and implement new fields which may not have been added to Pushraven yet. You can use the following methods (for any of the constructor classes: Message, Notification, config classes...):

addAttribute(String key, Object value);
addAttributeMap(String key, Map<?, ?> map);
addAttributeArray(String key, Collection<?> arr);
addAttributePayload(String key, Payload payload); // see:

3. Send the raven

// or (if you want to access the response)
FcmResponse response = Pushraven.push(raven);



A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.





No packages published


You can’t perform that action at this time.