Created
October 19, 2018 22:19
-
-
Save flurrydev/1371093287166277da41b12d3208599f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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