benCoding.AlarmManager icon indicating copy to clipboard operation
benCoding.AlarmManager copied to clipboard

icon property works only partly

Open AppWerft opened this issue 9 years ago • 3 comments

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.

AppWerft avatar May 13 '15 09:05 AppWerft

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,

janisr avatar Jun 02 '15 08:06 janisr

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.

AppWerft avatar Jun 02 '15 08:06 AppWerft

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.

michielvaneerd avatar Dec 08 '15 15:12 michielvaneerd