Skip to content

Commit 49a11f3

Browse files
Merge pull request #49 from mn-martin/patch-1
Fix: #48 (Improve Docs)
2 parents b0ffa06 + 3c28235 commit 49a11f3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@ Note that after a reboot the `smallIcon` and `largeIcon` are not restored but fa
8181
)
8282
```
8383

84+
### Notification icons
85+
86+
> __Background information:__ Local notifications may fail silently if you don't provide the notification icons in the correct dimensions. They may do work perfectly fine on one device but fail on the other. That's because android might fallback to your xxxhdpi launcher icon which is too big. This type of error is noticeable in logcat: `!!! FAILED BINDER TRANSACTION !!! (parcel size = 1435376)`
87+
88+
#### Spec for ic_stat_notify.png (smallIcon)
89+
90+
[Android API Guides → Status Bar Icons](https://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html)
91+
92+
#### Spec for ic_notify.png (largeIcon)
93+
94+
Unfortunately it seems like there's no official guide for these. Anyways there's a [dimen](https://github.com/android/platform_frameworks_base/blob/2d5dbba/core/res/res/values/dimens.xml#L181) that's telling us the dp size which we can translate to the following spec:
95+
96+
| Density qualifier | px | dpi
97+
| -- | -- | --
98+
| ldpi | 48 x 48 | 120
99+
| mdpi | 64 x 64 | 160
100+
| hdpi | 96 x 96 | 240
101+
| xhdpi | 128 x 128 | 320
102+
| xxhdpi | 192 x 192 | 480
103+
104+
__Don't include xxxhdpi__
105+
106+
> __xxxhdpi__: Extra-extra-extra-high-density uses (__launcher icon only__, see the note in Supporting Multiple Screens); approximately 640dpi. Added in API Level 18
107+
> Source: [Density Qualifier Docs](https://developer.android.com/guide/topics/resources/providing-resources.html#DensityQualifier)
108+
84109
### addOnMessageReceivedCallback
85110
Tapping a notification in the notification center will launch your app.
86111
But what if you scheduled two notifications and you want to know which one the user tapped?

0 commit comments

Comments
 (0)