benbahrenburg / benCoding.AlarmManager

Titanium Module for working with the Android AlarmManager
Other
98 stars 85 forks source link

icon property works only partly #60

Open AppWerft opened 9 years ago

AppWerft commented 9 years ago

I call:

var notification = {
    requestCode : id + alarm.eta,
    second : alarm.duration,
    icon : Ti.App.Android.R.drawable.alarm_icon,
    contentTitle : 'Labortimer@' + Moment().format('HH:mm'),
    contentText : alarm.label + ': duration=' + formatTime(alarm.duration),
    playSound : true,
    sound : Ti.Filesystem.getResRawDirectory() + sound.toLowerCase()
};
Notify.addAlarmNotification(notification);

On console I see:

{
"requestCode":2861402682,
"second":16,
"icon":2130837603,
"contentTitle":"Labortimer@10:13",
"contentText":"Timer 3: duration=00:00:16",
"playSound":true,
"sound":"android.resource://de.appwerft.eppendorf/raw/note"
}

Issue: I don't see myalarmicon, but a system icon.

NEXUS5 (5.1) Systemicon NEXUS7 (4.*) it works. SmartWatch LG it works

Any ideas? I have copied in every drawable folder a PNG. I have also tried to copy PNG in Ressources/android/images/.. folder: same issue.

janisr commented 9 years ago

To use an icon create images in

/platform/android/res/drawable-****/notification_icon.png

and reference it like this

icon : Ti.App.Android.R.drawable.notification_icon,
AppWerft commented 9 years ago

Hi janisr, I know this solution. But I see partly the right (colored) icon and partly the monochromatic, minified version. It depends on device. And I don't see the rule.

michielvaneerd commented 8 years ago

Hi, The icon is not displayed anymore for Android 5. You can use my fork if you want and set the "largeIcon" property. I created a PR also, so maybe this will be merged.