iOS subscribing to published event's by the Spark Core?


#1

Hi All. Sorry for peeking too much on your brain. I am a newbie and trying to figure some stuff out for a school project I am working on.

Does anyone have an idea for for my iPhone App to subscribe to an event produced from my spark core device. ( I am a very good iOS developer / SOSO Firmware developer / BAD Web Developer! :blush: ).

I want my iOS running app (Doesn’t need to be in the background) to notice when spark core publishes an event. (Kind of like the subscribe/publish eco system), but I want to subscribe from my iPhone or Android device…

Is there a way?

If there’s not… Does anyone has code to show of a simple webpage / web app (Node.js code) that does this? Maybe I can write some middleware to talk to the spark core server and when an event is publish, maybe send a push notification to my mobile.

Is this publish/subscribe thing following a HTML5 convention/practice that I can investigate further?


#2

This:


This:

This:

This:

This:

This:

This:

Or this:

Might be helpful.

Server Sent Events are indeed an HTML5 convention, and should be widely supported. I’ve got it working in Mobile Safari, so it works on your iPhone. There are some things to be found on how to include the SSE into a native app, but it might even be more user friendly to create a mobile app. You’ve got some metatag-thingies which allow you to run your page full screen when it’s saved to the springboard. That way, it’s universally accessible by anyone with a browser, you don’t have to pay the Apple developers fee (if you haven’t done so, or aren’t jailbroken), and don’t have to go through their verification process to get it in the app store. Seems like a lot of unnecessary trouble to go through for a school project. Unless it’s about programming for iOS…
Don’t worry about the web being harder to develop for. I’ve managed to get something working reasonably with SSE, and have ZERO programming experience, so it’s definitely doable.

Hope this somehow helps. Anyhow, good luck!


Printing out Spark events with JS