OneSignal / onesignal-expo-plugin

The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
Other
141 stars 45 forks source link

[question]: Confused about how to use smallIcons and largeIcons #225

Closed crieggalder closed 1 week ago

crieggalder commented 4 months ago

How can we help?

Hi - thanks for all your work on this package!

I was the requester who filed a ticket a while back for better Android icon support. Really nice to see it implemented--much appreciated!

I'm unclear about how to actually use the new smallIcons and largeIcons properties. Right now I have a folder of icons generated via Android Asset Studio as recommended in the OneSignal docs. This folder (res) contains a folder for each resolution with structure res/drawable-<resolution>dpi/ic_stat_onesignal_default.png, where is one of m, h, xh, xxh, xxxh.

How should I use this folder of icons with the smallIcons and largeIcons properties? Some added guidance in readme would help - I'd recommend a link to the generator and directions on how to use output with the properties.

Thanks again.

OneSignal Expo SDK version

50

Platform

Android

Relevant log output

No response

Code of Conduct

rgomezp commented 3 months ago

Expo projects get created with an assets directory. You should just be able to put them in there.

Example:

root
| - src
| --- assets
| ------ notifIcons
| --------- ic_onesignal_large_icon_default.png
| --------- ic_stat_onesignal_default.png

Then, in your plugins array:

plugins: [
    [
      "onesignal-expo-plugin",
      {
        "mode": process.env.APP_VARIANT === 'development' ? "development" : "production",
        "smallIcons": ["./src/assets/notifIcons/ic_stat_onesignal_default.png"],
        "largeIcons": ["./src/assets/notifIcons/ic_onesignal_large_icon_default.png"],
      }
    ],