Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize icon of expo push notifications?

I'm sending push notifications to an expo app, and I would like to customize the icon of the notification. How can this be done?

like image 843
zaki tutu Avatar asked Jul 04 '19 14:07

zaki tutu


1 Answers

It can be set in app.json in Expo.

"notification"

Configuration for remote (push) notifications.

{
   "expo":{
      "name":"firstApp",
      "description":"firstApp",
      "slug":"firstApp",
      "privacy":"public",
      "sdkVersion":"31.0.0",
      "notification":{
         "icon":"./assets/images/iconPushNotification.png"
      },
      "ios":{
         "bundleIdentifier":"com.firstApp.firstApp"
      },
      "android":{
         "package":"com.firstApp.firstApp",
         "versionCode":1,
         "permissions":[
            ""
         ]
      },
      "platforms":[
         "ios",
         "android"
      ],
      "version":"1.0.0",
      "orientation":"portrait",
      "icon":"./assets/images/robot-prod.png"
   }
}

If your app is a stand-alone app,(use Expokit)

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.

like image 96
hong developer Avatar answered Sep 22 '22 13:09

hong developer