Skip to content

Comment on Parse Partners with Twilio and Mailgun for the Release of Cloud Modules

Comments

I just read the entire Cloud Code and Cloud Modules documentation, and there's one thing that doesn't quite make sense to me. There seems to be a piece missing.

So you implement some HTTP API using Cloud Code, and you deploy it. Shouldn't their SDK, through magical synergy, expose the native function to communicate with that API on the device? It seems like I can implement my HTTP API using Cloud Code, but I still have to bring in something like RestKit or ASIHTTPRequest on the device to actually talk to it.

So they have native APIs for talking to their HTTP API, but not the custom ones you implement using cloud code? Their example shows them calling it with curl, rather than "here's how to call this from inside your native app that already uses all the other Parse goodies"

The API is exposed natively. Where you see the curl examples, there is a dropdown to show how to do it in other languages.

  [PFCloud callFunctionInBackground:@"averageStars"
           withParameters:@{@"movie": @"The Matrix"}
           block:^(NSNumber *ratings, NSError *error) {
    if (!error) {
       // ratings is 4.5
    }
  }];
We should probably default to something other than curl or tweak that UI a bit. Thanks for pointing this out.

Cool! That's what I was looking for.

Yes, it's a bit buried. I missed the dropdown on the right. Speaking of Twilio, their docs are very good for stuff like this. They use a big obvious segmented control for switching between XML and JSON, for example.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.