gpt4 book ai didi

android - 使用 channel ID 时,世博会通知不起作用

转载 作者:行者123 更新时间:2023-12-03 13:26:43 27 4
gpt4 key购买 nike

我正在使用以下代码在 Android 上为我的 expo react 应用程序创建两个 channel :

Notifications.setNotificationChannelAsync("default", {
name: "default",
importance: Notifications.AndroidImportance.MAX,
vibrationPattern: [0, 250, 250, 250],
lightColor: "#FF231F7C",
})

Notifications.setNotificationChannelAsync("gameupdates", {
name: "gameupdates",
importance: Notifications.AndroidImportance.MAX,
vibrationPattern: [0, 250, 250, 250],
lightColor: "#FF231F7C",
})
该 channel 已成功创建,我什至可以在进入 Expo 应用程序通知选项时找到它。
当我使用 expo's tool 发送通知时没有任何 channel ID,它工作正常。但是,当我使用 channel ID“gameupdates”时,通知永远不会到达我的手机。
知道为什么吗?
我在世博 SDK 38 上。

最佳答案

解决它!问题是我需要添加 android.useNextNotificationsApi: true到 app.json。
然后我不得不做expo:build手动 上传构建。

关于android - 使用 channel ID 时,世博会通知不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63338534/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com