0

possible to subscribe with Rest API?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

possible to subscribe with Rest API?

by sketchy on Sat Feb 09, 2019 8:08 am

I've used mqtt in the past. I'm starting a project in Flutter. While there is a 3rd party mqtt client, it is not clear to me how robust it is. So I was looking into using the REST client. Is it possible to subscribe to a feed's changes using the REST API? From the docs, I am assuming no. But wanted to check. Thank you.

sketchy
 
Posts: 245
Joined: Thu Jun 28, 2012 11:37 pm

Re: possible to subscribe with Rest API?

by brubell on Mon Feb 11, 2019 11:26 am

MQTT will update when a feed updates (on_message), but the API client will not. To get around this, you may want to save the feed's value and poll, check if the the new received value is different.

brubell
 
Posts: 494
Joined: Fri Jul 17, 2015 10:33 pm

Re: possible to subscribe with Rest API?

by sketchy on Mon Feb 11, 2019 11:29 am

Thank you very much for the reply. I thought polling was the answer. This would probably work fine. With that said, I'm exploring mostly for the learning - using mqttt to Adafruit.io from a flutter/dart app.

sketchy
 
Posts: 245
Joined: Thu Jun 28, 2012 11:37 pm

Please be positive and constructive with your questions and comments.