iOS Question httpJob with event handling using Particle Photon

Discussion in 'iOS Questions' started by alizeti, Jun 13, 2018.

  1. alizeti

    alizeti Member Licensed User

    On windows terminal using curl, this is my steps :

    step 1 : start the event listening
    command :
    curl ""
    Response :

    Step 2 : generate the event on the cloud through the particle module

    Step 3 : Receive the event on windows terminal after 10 sec (for test purpose)
    event: manCtrlTimer
    data: {"data":"Valve close","ttl":60,"published_at":"2018-06-08T14:14:46.017Z","coreid":"device_id"}

    On the App, if I do the same steps, I get nothing.
    jobDone is not triggered.
    I just replace all the global jobDone function with local to to Subs and still nothing.
  2. Erel

    Erel Administrator Staff Member Licensed User

    Posting hundreds of lines of code will not help.

    Where is the documentation of this web service API?

    Create a new project with this code:
    Private Sub Application_Start (Nav As NavigationController)
       NavControl = Nav
       Page1.Title = 
    "Page 1"
       Page1.RootPanel.Color = 
    Dim j As HttpJob
    "", Me)
    Wait For (j) JobDone (j As HttpJob)
    If j.Success Then
    End If
    End Sub
    What happens?
    Last edited: Jun 14, 2018
  3. alizeti

    alizeti Member Licensed User

    This is the link for the documentation

    I did the new project. Nothing happens. The app start, but no log appears like if it never quit the "Wait For"

    At the same time, i open an cmd line terminal on windows and this is the output :


    event: manCtrlTimer
    data: {"data":"Zone 8 is now CLOSE","ttl":60,"published_at":"2018-06-14T12:25:37.693Z","coreid":"dasilvaPhoton"}

    event: manCtrlTimer
    data: {"data":"Zone 8 is now CLOSE","ttl":60,"published_at":"2018-06-14T12:25:56.710Z","coreid":"dasilvaPhoton"}
  4. Erel

    Erel Administrator Staff Member Licensed User

    As @OliverA wrote in the other thread the internal HTTP framework doesn't support server events. iOS doesn't support it natively.

    Check whether they provide a different method. Maybe websockets.
  5. alizeti

    alizeti Member Licensed User

    like @OliverA said :
    If you look at the API docs of for events ( you'll see the mentioning of streams. All this supports my "guess" that is using Server Side Events (SSEs) for publishing events and that HttpJob is currently not the right tool to deal with SSEs. A possible solution may be an implementation of this library ( for B4i. Please note that library was just a quick search (two others had no activity in awhile: and

    What do you think
  6. Erel

    Erel Administrator Staff Member Licensed User

    You can post it in the wishlist forum. There is good support for other long lasting connections (MQTT and WebSockets). I'm not sure that it will be added.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice