简体   繁体   中英

How to wake an application from a backend server process?

Lets say your server completes a process, a timer or something, and wants to call back to the application to update its state, regardless of whether or not the app is in the background/closed. What's the best way to handle this, FCM? And will that ensure the app always wakes?

Yes, it is good case for FCM. Just send message from server and do what you want in FCM listener in app.

There are two types of messages in FCM: display messages and data messages. Display messages trigger the onMessageReceived only when app in foreground, data messages is what you want - trigger callback even if app killed.

There is answer with details how exactly do what you want.

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