oracle / oracle/pushiomanager-react-native
On Android setSmallIcon when used with an XML resource adds unneeded padding, makes notification icon look incorrect.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 19
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Our notification icon is an XML resource. As you can see the icon is not scaled correctly and seems to have padding. When used with pure FCM push (no Responsys) the icon appears correctly and at the right size. Also it would be nice if you provided a setIconColor function (for default_notification_color) in order to style the icon for when the icon is provided in XML format. When a PNG resource is used, the icon appears correctly in Responsys. So this is an incompatibility with XML icons.
Is there a reason you can't use the default icon settings that are already passed to FCM in AndroidManifest?
The native code is as follows:
// if it's a responsys push, set the icon and handle it with Responsys
if (pushIOManager.isResponsysPush(remoteMessage)) {
String appName = reactContext.getPackageName();
int notificationIconID = reactContext.getResources().getIdentifier("ic_launcher_foreground", "drawable", appName);
pushIOManager.setDefaultSmallIcon(notificationIconID);
pushIOManager.setDefaultLargeIcon(notificationIconID);
pushIOManager.handleMessage(remoteMessage);
} else {
// Otherwise not a Responsys push notification, handle it through FCM only
FCMModule.onMessageReceived(reactContext, dataMap);
}
Responsys:


FCM:


Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the native Java code shown in the issue, especially the Responsys branch using setDefaultSmallIcon and setDefaultLargeIcon, and compare it with the FCM path. Reproduce the notification with an XML resource and a PNG resource, then verify the icon sizing and color behavior against the reported screenshots. Done means XML icons render without unwanted padding and the requested default icon color behavior is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, react-native
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100