English 中文(简体)
接触通知——如何更新具体通知内容?
原标题:Expo Notification - How to update a specific notification content?

我在“博览会”通知下开始了一个很少的项目,我谨更新预定的通知内容(内容)。 看看官方的新闻中心,我看不出如何这样做。

例如,我可以通过打字方式安排通知:

const id = await Notifications.scheduleNotificationAsync({
  content: {
     title:  Notification ,
     body:  Notification body ,
     subtitle:  Order progress 
  }
});

通过通知识别符号id, 我以某种方式更新这一具体通知内容:

// Example
Notifications.updateNotificationAsync(id, { 
 content: {
    title:  Stocks notification ,
    body:  Updated body ,
    subtitle:  Updated order progress 
 }
});

是否可能?

感谢很多。

问题回答

There is no API for that. You can only cancel the existing notification and schedule a new one with updated data.





相关问题
HandleClick not being recognized as a prop

I m trying to get my menu to show when I click the sidebar, but I m getting an error "react-dom.development.js:86 Warning: React does not recognize the handleClick prop on a DOM " import { ...

Is there an equivalent to localStorage in React Native?

I d like to implement the equivalent to the javascript localStorage in my React Native app. But I m unsure how to set. To function how I want it to, I would like the localStorage to be stored every ...

Video Calling in Expo React Native Application

I am building a React Native Application using Expo and I want to integrate a 1:1 video calling functionality in the app. From what I have researched so far on the topic is that I can use SDKs of ...

热门标签