Specifying a custom icon with icons\list_icon doesn't seem to work

I've been trying to specify a custom icon for android as per docs: list_icon_example

However the icon is always the default.

I've been experimenting with the following example:

let pushObject = {
    audience:"ALL" , // or specify your target audience
    device_types: ['android'],
    notification: {
        "alert": "Goal 🚨"
    },
    "message": {
  "title": "This is Great 😍",
    "content_type": "text/html",
    "icons": {
      "list_icon": "http://static.thenounproject.com/png/3061218-200.png"
    }
  }
};

 

Didn't find what you were looking for?

New post

Comments

1 comment

  • To solve the issue with specifying a custom icon using list_icon in the Android push notification setup, ensure that you are following the correct approach with the counting tools functionality that manages dynamic assets like icons. Here's a solution to properly implement a custom icon:

    1. Correct Structure and Parameters: Ensure that the key for specifying the icon is correct in your object. You should define the list_icon within the notification field, and the icon URL should be accessible and properly formatted. Here's an updated version:
    javascript
    Copy code
    let pushObject = { audience: "ALL", // or specify your target audience device_types: ['android'], notification: { "alert": "Goal 🚨" }, "message": { "title": "This is Great 😍", "content_type": "text/html", "icons": { "list_icon": "http://static.thenounproject.com/png/3061218-200.png" // Custom icon URL } } };
    1. Check Icon URL and Permissions: Ensure that the URL you’re using for the custom icon is accessible and that the image is hosted on a publicly available server. If it’s not accessible, the default icon will be used instead.

    2. Use of Correct API: The example you’ve provided suggests using a push notification API that includes the custom list_icon. If the API doesn't support custom icons or if it doesn't load as expected, verify that the service you're using supports this feature and that the custom icon is correctly recognized.

    3. Test Across Devices: Make sure to test your custom icon on different devices. Sometimes, Android devices may have restrictions or caching issues that prevent new icons from showing until the app cache is cleared.

    By integrating these techniques and ensuring the right use of counting tools like dynamic asset linking (e.g., the custom icon), you can effectively customize and manage the appearance of your push notifications.

    Comment actions Permalink
    0

Please sign in to leave a comment.