Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

icon property works only partly #60

Open
AppWerft opened this issue May 13, 2015 · 3 comments
Open

icon property works only partly #60

AppWerft opened this issue May 13, 2015 · 3 comments

Comments

@AppWerft
Copy link

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
Copy link
Contributor

janisr commented Jun 2, 2015

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
Copy link
Author

AppWerft commented Jun 2, 2015

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
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants