exponea / exponea-android-sdk

MIT License
17 stars 16 forks source link

Setting Push Icon color is not working #32

Closed rkaartikeyan closed 4 years ago

rkaartikeyan commented 4 years ago

Dear Team,

Thanks for the SDK. below is the configuration in my MainApplication.java. I am able to see the Push Icon in the notification section on the android device. But it's always dark gray color.

Please let me know what I have missed in this.

    configuration.setAutomaticSessionTracking(true);
    configuration.setAutomaticPushNotification(true);
    configuration.setPushChannelName("HelloWorld");
    configuration.setPushChannelDescription("HelloWorld Notifications");
    configuration.setPushChannelId("0");
    configuration.setPushIcon(R.drawable.ic_red);
    configuration.setPushAccentColor(R.color.dark_red);
    configuration.setPushNotificationImportance(NotificationManager.IMPORTANCE_DEFAULT);
    configuration.setTokenTrackFrequency(ExponeaConfiguration.TokenFrequency.ON_TOKEN_CHANGE);
wassil commented 4 years ago

Hi, if you're talking about the small notification icon in status bar, that is grey because the operating system always sets it to grey.

rkaartikeyan commented 4 years ago

Dear @wassil thanks for your response, when we expand the notification. The other notification are having coloured icons.

please check above screenshot.

I want to make like this.

I thought the AccentColor prop is for this.

wassil commented 4 years ago

Gotcha. The problem is you're giving the SDK resource id, not color id. R.color.dark_red gives you a resource id, context.resources.getColor(R.color.dark_red) gives you a color id which is what is expected here. If you don't see the changes, try removing an re-installing the app, configuration may be stored between app runs.

In documentation we only give example with Color.GREEN(that's color id). It's a bit confusing - more than a bit, I'll improve the documentation on this.

rkaartikeyan commented 4 years ago

@wassil thanks a lot, it's working now.