appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

Webhooks #308

Open kennydude opened 11 years ago

kennydude commented 11 years ago

I would like to see the ability to have Webhooks in ADN for a number of events that happen in the system. Similar to how Github does these with Github Services which work really well.

Built-in ones could be GCM, HTTP Post and a few others (iOS push or whatever, although I know it's not as extensible as GCM).

"But we have streams for this" - True, this is how you would roughly get a mention to someone with a stream:

Diagram

That's a lot of work just for a mention to be sent to a phone! That means it costs more in money and servers that we don't need. Using webhooks, we could get down to this:

Diagram

It could also be used to subscribe to events such as:

What do you guys think?

derelk commented 11 years ago

I agree that the current stream type of "long polling" is not ideal. It is somewhat more of a burden on the developer to keep these persistent HTTP connections open. I would prefer something more like Facebook's subscription setup that uses an HTTP callback.

@kennydude Are you proposing ADN directly sends GCM and APN messages directly? How would that work exactly? The client registers push tokens directly with ADN? I believe there are would be some authentication/security issues with that approach.

kennydude commented 11 years ago

For GCM, ADN would have a shared sender id which would be public. However, the actual Auth token ADN would need would be secret.

Then the actual device tokens would be useless against everyone but ADN. I'll explain a bit better later on today On 12 Mar 2013 23:12, "Derek" notifications@github.com wrote:

I agree that the current stream type of "long polling" is not ideal. It is somewhat more of a burden on the developer to keep these persistent HTTP connections open. I would prefer something more like Facebook's subscription setup that uses an HTTP callback.

@kennydude https://github.com/kennydude Are you proposing ADN directly sends GCM and APN messages directly? How would that work exactly? The client registers push tokens directly with ADN? I believe there are would be some authentication/security issues with that approach.

— Reply to this email directly or view it on GitHubhttps://github.com/appdotnet/api-spec/issues/308#issuecomment-14812048 .

kennydude commented 11 years ago

There would be no security issues. In fact, less than adding another server in between because otherwise you have this issue of potentially privacy concious information being transferred to a server we know nothing about. (You can strip out private content from GCM and simply ping apps to say "there's new data, fetch it when you're ready")