简体   繁体   中英

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,

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.

I think your question is not about Flutter, actually. 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. 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.

This way, it will work even though the app is not running in the background

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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