简体   繁体   English

如何自定义展会推送通知的图标?

[英]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?如何才能做到这一点?

It can be set in app.json in Expo .它可以在Expo app.json中设置。

"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)

ExpoKit : To change the notification icon, edit or replace the shell_notification_icon.png files in android/app/src/main/res/mipmap-. ExpoKit :要更改通知图标,请编辑或替换 android/app/src/main/res/mipmap- 中的 shell_notification_icon.png 文件。 On iOS, notification icons are the same as the app icon.在 iOS 上,通知图标与应用程序图标相同。 All other properties are set at runtime.所有其他属性在运行时设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM