possible to subscribe with Rest API?

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
sketchy
 
Posts: 285
Joined: Thu Jun 28, 2012 11:37 pm

possible to subscribe with Rest API?

Post by sketchy »

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.

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: possible to subscribe with Rest API?

Post by brubell »

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.

User avatar
sketchy
 
Posts: 285
Joined: Thu Jun 28, 2012 11:37 pm

Re: possible to subscribe with Rest API?

Post by sketchy »

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.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”