如何在Expo推送通知上添加自定义图标?

huangapple go评论61阅读模式
英文:

How do i add custom icon on expo push notification?

问题

我按照Expo的文档指南链接 进行了操作,但仍然无法工作,推送通知中的图标未显示。

{
  "expo": {
    ...
    "android": {
      "package": "com.moohub.safenaija",
      "googleServicesFile": "./google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": ".......",
      }
    }
  },
  "plugins": [
    [
      "expo-notifications",
      {
        "icon": "./assets/safe.png",
        "color": "#000000",
        "iosDisplayInForeground": true,
        "androidMode": "default",
        "androidCollapsedTitle": "Updates from SafeNaija"
      }
    ]
  ]
}

如果有人能帮助解决这个问题,我将不胜感激。

英文:

i followed the documentation guide on expo link , yet it doesn't work ,the icon is not displayed in the push notification

    {
  "expo": {
  
......
    "android": {
      "package": "com.moohub.safenaija",
      "googleServicesFile": "./google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "......."
      }
    }
  },
  "plugins": [
    [
      "expo-notifications",
      {
        "icon": "./assets/safe.png",
        "color": "#000000'",
        "iosDisplayInForeground": true,
        "androidMode": "default",
        "androidCollapsedTitle": "Updates from SafeNaija"
      }
    ]
  ]
}

i would appreciate if someone can help solve this issue

答案1

得分: 0

我通过使用具有单色和透明背景的标志来解决了这个问题,生产中一切正常,显示标准标志。

英文:

for people who might have come across this issue, i solved it by using a logo with monochrome color and a transparent background,in production it all works well and displays the standard logo

huangapple
  • 本文由 发表于 2023年2月24日 16:04:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/75553980.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定