react-native - 如何检测 React Native 中的抽屉通知?
问题描述
我尝试将来自 react-native 的 AppState 与模糊侦听器一起使用,但没有显示任何内容。我做了完全相同的代码https://reactnative.dev/docs/appstate但模糊侦听器不起作用。我只想知道通知抽屉(https://developer.android.com/guide/topics/ui/notifiers/notifications#bar-and-drawer)何时出现在我的应用程序屏幕上
export default class AppStateExample extends Component {
state = {
appState: AppState.currentState
};
componentDidMount() {
AppState.addEventListener("blur", this._handleAppStateChange);
}
componentWillUnmount() {
AppState.removeEventListener("blur", this._handleAppStateChange);
}
_handleAppStateChange = nextAppState => {
console.log("test")
};
}
感谢帮助 !
解决方案
推荐阅读
- distributed-transactions - 关于在 YugabyteDB 中使用 safe_time 的说明
- java - 包含与 ObservableList() 总是返回 false
- c - 为什么我必须发送两次信号?
- selenium-chromedriver - 错误:类型不匹配:无法从 ChromeDriver 转换为 WebDriver
- pine-script - Pine 脚本 - 在满足购买条件后仅绘制一次
- python - 根据标准查找另一个数据框的最有效方法,用于按 3D 尺寸和重量包装问题
- java - 降级到 jdk11 后无法构建 JavaFx 项目
- php - Laravel 雄辩的 whereHas() 无法使用 with() 急切加载
- acumatica - 与推送通知调度错误相关的 Acumatica 和系统崩溃
- r - 汇总每个网格单元格的统计数据并在 R 中绘制热图