If you've completed the steps described in the Setup guides, you are now ready to implement our Android library in your app. Our library supports Android version 4.1 and up, but is only fully functional from version 4.4 (KitKat) up to Android 10. Make sure you always have the latest Android SDK when using this library.

If you are upgrading from an older version of our library, it's always a good idea to read our Upgrade file.

Add Dependencies

For your convenience we've created a Maven repository that simplifies how you include our library in your app. Open the /app/build.gradle file in your project and add the following entries:

repositories {
    maven {
        url ""
dependencies {
    implementation 're.notifica:notificare-core:2.3.0' // make sure you use the latest version available
    implementation 're.notifica:notificare-location:2.3.0' // if you never gonna use location or geofences, you can leave this one out
    // implementation 're.notifica:notificare-beacon:2.3.0' // only needed if you wanna use beacons
    // implementation 're.notifica:notificare-scannable:2.3.0' // only needed if you wanna use scannable items

This will make sure you have the latest Notificare, Google Play and Support libraries.

Add a Notificare Configuration file

In order to connect your app to Notificare, you must create a file /app/assets/ with the following contents:

developmentApplicationKey = xxx
developmentApplicationSecret = xxx
productionApplicationKey = xxx
productionApplicationSecret = xxx
production = false

It is recommended that you create at least two different apps in Notificare using separated environments for development and production. For each app you will have a different set of keys, these keys should be copied and pasted in the file shown above. The production property should be changed according to the environment you are building for. You can find your app keys by expanding your app's Settings menu item and clicking in App Keys as shown below:


Copy both the Application Key and Application Secret:


Add Firebase Cloud Messaging

Android Studio makes it easy to quickly import the FCM project you've created previously in your app. Simply expand in Tools menu and click in Firebase:

android studio tools firebase

This will open an Assistant window like the one below:

android studio firebase assistant

Simply click in the Set up Firebase Cloud Messaging and follow the guides in the following screen:

android studio firebase setup

Completing point 1 and 2 will prepare your app with everything needed to use the FCM project you've previously created.

Now, a file /app/google-services.json should have been created. This file will have the information about the Sender ID of your FCM project.

Create an Intent Receiver

By default you could simply use the * class as your Intent Receiver class, but in order to gain more control over Notificare, you will want to create your own Intent Receiver.

This will make sure you can control device registration, notifications received, actions, etc. Go ahead and create a class like the one below:

public class MyIntentReceiver extends DefaultIntentReceiver {

    public void onReady() {

        // At this point you have been assigned a temporary device identifier
        // All services subscribed can be used


    public void onDeviceRegistered(NotificareDevice device) {

        // At this point you know a device is registered with the Notificare API
        // This method will be called every time something changes, be it token, push enabled/disabled or other property changes
        // Use this method to keep track of device changes in your own app or act on those changes


Extend Base Application

For exactly the same reasons as you extend the Intent Receiver, you will also want to create your own Application class where you'll be launching Notificare's library, instead of using the This will make sure you can customize the launching options as you see fit for your application. Go ahead and create a class like the one below:

public class MyBaseApplication extends Application {
    public void onCreate() {

        //Set debug logging
        //Launch Notificare system

        //Crash logs are enabled by default, set it to false to disable them
        //Create and set default channel

        //Point to your own Intent Receiver

        //Allow or disallow orientation changes

        // Uncomment to use a different icon for notifications
        // Uncomment to use a different accent color for notifications
        //Notificare.shared().setNotificationAccentColor(ContextCompat.getColor(this, R.color.notification_accent_color));
        // Uncommment this to show a notification light by default, even if it isn't sent with the incoming notification
        //Passbook related configuration:
        //The SDK supports a single optional placeholder, %s.
        //If the placeholder is provided, it will be replaced by the pass description, if any.
        //Notificare.shared().setRelevanceText("Notificare demo: %s");

Android Manifest

Finally you need to configure the application and default activities in your Android Manifest file.

Finally make sure your application is declared as follows in your AndroidManifest.xml:


    <!-- This will be the notification UI activity -->

    <!-- If you are using the loyalty add-on -->
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
                android:scheme="https" />

    <!-- Point to your own Intent Receiver -->
    <receiver android:name=".MyIntentReceiver" />

    <!-- API key for Maps. It is needed when you want to push a map notification type. Get your Maps API Key from your Google API Console -->
        android:value="GOOGLE_MAP_KEY_HERE" />

    <!-- If you use custom URL Schemes in HTML and Website push notifications, you will want to provide them in this manifest. You will also want to create a resource file with an array of URL Schemes that can be handled in notifications. Any click or events that invoke these URL Schemes will then trigger a method in your custom Intent Receiver -->
        android:resource="@array/url_schemes" />


As you can see, this example adds a translucent style to the NotificationActivity to allow it to show alerts floating over your main content, you will need to set up styles for this in your app's theme, e.g.:

<style name="AppTheme.Translucent" parent="AppTheme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>

At this point, you have completed the basic setup of our library. Keep reading our implementation guides to dive deeper into each features available in our SDK.