'How to change expo push notification icon and point to a specific screen when app is closed

The problem I am having is that

  • push notifications received from expo notification service always have the expo icon instead of the one specified (my app's icon),

  • and when clicked point to the expo client instead of the standalone app

Local scheduled notification show the app icon as intended

Questions:

  1. How can I change the remote notification icon to a custom one and

  2. point to a specific path/screen in the standalone app instead of the expo client?

Image description: Top notification shows a local scheduled notification and bottom the push notification using the expo push notification service

Top notification shows a local scheduled notification and bottom the push notification using the expo push notification service

my app.json:

  "expo": {
    "name": "Vevivo",
    "slug": "Vevivo",
    "privacy": "public",
    "sdkVersion": "34.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.2.2",
    "orientation": "portrait",
    "icon": "./assets/images/AppIcon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "primaryColor": "#E6762F",
    "scheme": "vevivo",
    "ios": {
      "supportsTablet": false,
      "bundleIdentifier": "com.vevivo.vevivo"
    },
    "android": {
      "package": "com.vevivo.vevivo",
      "googleServicesFile": "./google-services.json",
      "versionCode": 5
    },
    "notification": {
      "icon": "https://vevivo-images-bucket-develop.s3-eu-west-1.amazonaws.com/public/common/logo96Gray.png",

}

Any help will be much appreciated!



Solution 1:[1]

You're trying to see your notification icon in iOS so your app should be standalone app.

ExpoKit: To change the notification icon, edit or replace the shell_notification_icon.png files in android/app/src/main/res/mipmap-. On iOS, notification icons are the same as the app icon. All other properties are set at runtime.

For build for standalone app follows this guide

Solution 2:[2]

Run in managed app (not bare - Expo Client):

try push the icon to local assets:

expo": {
    ....
    "notification": {
      "icon": "./assets/images/logo96Gray.png"
    },

Solution 3:[3]

due to the time it has already resolved, but for future doubts I believe I can help, your code is right but you seem to be using the expo and not the generated application, try to generate a standalone version that the notifications should appear normally, also check the image size to avoid problems, check out this answer for that.

types of images for push notification

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 berkaygurbuz
Solution 2 Oleg
Solution 3 Jeison GuimarĂ£es