简体   繁体   English

如何在React Native Expo中使用按钮发送通知

[英]How to send notification with button in react native expo

I am working on app where I have some requirement , Actually I want to send notification when user click on button .我正在开发我有一些要求的应用程序,实际上我想在用户单击按钮时发送通知。 I really tried but didn't find any solution .我真的尝试过,但没有找到任何解决方案。 Could someone please help me how to resolve this issue .有人可以帮助我如何解决这个问题。

Thanks谢谢

I'm not sure what the point of sending a notification immediately after pressing a button is, however, Expo provides a nice library expo-notifications :我不确定按下按钮后立即发送通知的意义是什么,但是,Expo 提供了一个不错的库expo-notifications

Use presentNotificationAsync in order to immediately present a notification.使用presentNotificationAsync以立即呈现通知。

Use scheduleNotificationAsync in order to schedule a notification in the future.使用scheduleNotificationAsync以便在将来安排通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM