[英]How can I set push notification in flutter for my app?
I have a rate alert feature in my app in which the user can set rate alert for both gold and silver price,I am using socket for fetching gold and silver rate,So how can i set push notification in my app when the price is same as the price chosen by the user,how can i listen to the gold rate stream if my app is in background and how to can i compare the rate by user to the current rate Please help me to sought this out,我的应用程序中有一个汇率提醒功能,用户可以在其中为黄金和白银价格设置汇率提醒,我正在使用套接字获取黄金和白银汇率,那么当价格相同时如何在我的应用程序中设置推送通知作为用户选择的价格,如果我的应用程序在后台,我如何收听黄金汇率 stream 以及如何将用户的汇率与当前汇率进行比较请帮助我找到这个,
I tired Flutter Awsome Package for push notification but the problem is I was not able to schedule notification correctly when the price is same as current live rate in the backgorund.我厌倦了 Flutter Awsome Package 的推送通知,但问题是当价格与背景中的当前实时价格相同时,我无法正确安排通知。
I think your question is not about Flutter, actually.我认为您的问题实际上与 Flutter 无关。 You need to transfer this responsibility to your backend.
您需要将此责任转移到后端。 You only need to provide to your database with the Token of the user's device, and the Price and asset he wants to get notification for.
您只需要向您的数据库提供用户设备的 Token,以及他想要获得通知的价格和资产。 The backend will handle the asset follow-up and, when the price reaches the user preference, you'll use the provided Token to send him a Push Notification.
后台会处理资产跟进,当价格达到用户偏好时,你会使用提供的Token给他发送一个Push Notification。
This way, it will work even though the app is not running in the background这样,即使应用程序未在后台运行,它也能正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.