android - 面向玩家的 Expo React 粘性通知
问题描述
我想为我的 android 音频播放器添加粘性通知并通过应用通知处理播放器,但我不知道该怎么做我尝试了 expo 官方通知文件但失败了,请在这种情况下帮助我。
useEffect(() => {
async function body() {
Notifications.dismissAllNotificationsAsync();
const localNotification = {
title: 'this.state.notifTitle',
body: 'this.state.notifMessage',
android: {
sticky: true,
priority: 'max',
},
};
Notifications.presentLocalNotificationAsync(localNotification);
}
body();
// Notifications.addListener((n) => {
// console.log('notificationss', n);
// });
}, []);
解决方案
推荐阅读
- android - Flutter 项目,一些文件名在 Android Studio 中没有被识别为 .dart 文件
- r - 在函数中添加停止条件作为 R 中的输入参数
- r - 如何通过基于行值创建新变量来重塑数据框以进行分析
- attributes - 如何自动合并相邻的多边形
- sql - 如何在带有 FOR JSON 的 sql 中使用 Trim
- android - 导航组件有条件的popUpTo?
- android - 为什么右键单击在 ChromeBook 上不起作用?
- python - 在 plotly 中更新绘图上的 xy 数据
- javascript - 如何将 json 对象键转换为不同的数组来删除重复项
- angular - 为什么控制台在从 API Angular 获取数据后会出错