Skip to content

Instantly share code, notes, and snippets.

@flurrydev
Created October 19, 2018 22:19
Show Gist options
  • Select an option

  • Save flurrydev/1371093287166277da41b12d3208599f to your computer and use it in GitHub Desktop.

Select an option

Save flurrydev/1371093287166277da41b12d3208599f to your computer and use it in GitHub Desktop.
private void initializeFlurry() {
...
// pass Flurry the default icon id, and background color
int notificationIcon = getNotificationIcon();
FlurryMarketingOptions flurryMarketingOptions = new FlurryMarketingOptions.Builder()
...
.withDefaultNotificationIconResourceId(notificationIcon)
.withDefaultNotificationIconAccentColor(getResources().getColor(R.color.notification_icon_background))
...
.build();
FlurryMarketingModule marketingModule = new FlurryMarketingModule(flurryMessagingOptions);
...
}
private int getNotificationIcon() {
// based on the current device's Build, return the appropriate icon. Note: If you only return an icon 21+, a device < 21 will still show the icon, but will not have a background color.
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
return R.drawable.ic_notification_white_and_transparent;
} else {
return R.drawable.ic_notification;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment