It looks like apps designed for SDK 21 (Lollipop) icons are automatically filtered to white - The notification bar icon turns white in Android 5 Lollipop . Therefore, to fix this, you can either set the target version of the SDK to 20, or manually change the phonegap Urban Airship plugin and install the icon manually, replacing the execute method in https://github.com/urbanairship/phonegap-ua-push/blob/ master / src / android / PushAutopilot.java with the following:
@Override public void execute(final Application application) { // Parse cordova config options AirshipOptions configOptions = new AirshipOptions(application); final boolean enablePushOnLaunch = configOptions.getBoolean(ENABLE_PUSH_ONLAUNCH, false); UAirship.takeOff(application, getAirshipConfig(application, configOptions), new UAirship.OnReadyCallback() { @Override public void onAirshipReady(UAirship airship) { // Create a new notification factory DefaultNotificationFactory defaultNotificationFactory = new DefaultNotificationFactory(application); // Customize the notification icon and accent color defaultNotificationFactory.setSmallIconId(R.drawable.ic_notification); defaultNotificationFactory.setColor(NotificationCompat.COLOR_DEFAULT); // Set the factory airship.getPushManager().setNotificationFactory(defaultNotificationFactory); if (enablePushOnLaunch) { airship.getPushManager().setUserNotificationsEnabled(true); } } }); }
Replace R.drawable_ic_notification with the icon that you included in your project.
Update: A 3.0.0 plugin has been released that allows you to specify the accent color and the assigned name in the config without changing any code.
<preference name="com.urbanairship.notification_icon" value="ic_notification" /> <preference name="com.urbanairship.notification_accent_color" value="#0000ff" />
More information can be found here - https://github.com/urbanairship/phonegap-ua-push
source share