【发布时间】:2018-09-17 18:01:23
【问题描述】:
有没有办法让应用程序的通知保持在锁定屏幕上,并且无论应用程序的状态如何(运行或终止),例如 Weather Channel 应用程序,通知都会在 Android 中下拉。但在本机反应。
如果可能的话,我还希望有一个带有操作按钮的自定义通知。
【问题讨论】:
标签: android react-native notifications sticky foreground
有没有办法让应用程序的通知保持在锁定屏幕上,并且无论应用程序的状态如何(运行或终止),例如 Weather Channel 应用程序,通知都会在 Android 中下拉。但在本机反应。
如果可能的话,我还希望有一个带有操作按钮的自定义通知。
【问题讨论】:
标签: android react-native notifications sticky foreground
使用React native push notifications
如果你想让它变得有粘性并且需要自定义操作,你可以像下面这样设置
PushNotification.localNotification({
ongoing:true,
actions: '["Yes", "No"]'
})
检查Custom action handling 以处理您的自定义操作
【讨论】: