【发布时间】:2020-08-08 19:08:39
【问题描述】:
根据文档,我需要一个 96x96 灰色透明 png。我已经创建了这个并将以下内容放入我的 app.json 文件中,但我仍然看到了 expo 图标。有什么我遗漏的吗?
"notification": {
"icon": "http://example.com/pushIcon.png"
}
发送推送通知的代码
try {
fetch("https://exp.host/--/api/v2/push/send", {
method: "POST",
headers: {
Accept: "application/json",
"Accept-Encoding": "gzip, deflate",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: messages.map((value, index) => value.pushToken),
sound: "default",
title: 'Notification title',
body: "This is the body of the notification",
}),
});
} catch (err) {
alert("Unable to send request, please try again later.");
console.log(err);
}
【问题讨论】:
标签: react-native push-notification expo