SDK

Customizations

In this page we'll dive deeper into several aspects of our Android library that can be customized to match your needs.

Notification LED Settings

You can send along the preferred color and blinking time of the notification light (only works on selected device models) per notification from the Notificare REST API or the Dashboard. However, you can also set a default color for your app. If neither are set, it defaults to white colored blinking for 500 ms on and 1500 ms off.

Notificare.shared().setDefaultLightsColor("red");
Notificare.shared().setDefaultLightsOn(1000);
Notificare.shared().setDefaultLightsOff(2000);

Notifications UI

Changing user interface in the Android is intrinsically decided by your app's styles. Basically Notificare will just use the styles you provide in your app, for the several elements used throughout our UI. We recommend these changes are done in your /res/values folders like shown below:

android styles

Action Labels

Labels used for Action Buttons in both the Notification Manager as well as Notification Dialogs can be localized by adding them as strings resources, where the name is equal to the label. To protect collision of resource names, they can be prefixed with a string. The prefix must then be set by calling Notificare.shared().setLocalizedActionLabelPrefix().

ProGuard

If you use ProGuard, rules for classes to keep are included with the AAR, so there is no need to manually add any rules for Notificare.

65k method limit exceeded

Notificare Android library is tested to work with MultiDex, both natively (Android 5 and above) as well as with the MultiDex support library.

Add the following to your app's build.gradle

defaultConfig {
  multiDexEnabled true
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}

Then, override the attachBaseContext method in the Application class for your app.

@Override
protected void attachBaseContext(Context base) {
  super.attachBaseContext(base);
  MultiDex.install(this);
}

For more information on MultiDex and possible issues and workarounds, see Android Developer Documentation