So any further discussion here?
It seems like people at are odds on supporting fully javascript apis
(and containers), and/or giving containers more options such as
navigating away on calls like these.. but then that totally breaks the
whole idea of a full javascript api..
I say that we need to find a way to tell apps what actually happened
when they made these calls.. so options so far are:
1) DataResponse items
2) optional callback
3) asynch ping
4) app defined requestNavigateTo, after operation is complete.
I like the cleanliness of #1, but if we can't guarantee a fully
javascript dialog, etc.. then #4 is a requirement.
Here is my reasoning; user work flow and usability. Having your users
invite their friends is a key use case, and apps need to be able to
control what happens before and after that particular work flow. You
need to give the apps a chance to continue/follow through on whatever
workflow they were setting up; instead of always dumping users to the
app's home page..
That is why I asked for the requestShareApp to carry with it
NavigateTo parameters for where a user goes after they accept the
invite. I just realized that we also need NavigateTo parameters to
say where the inviting user goes after they send the invites.
Again, the fully javascript method is the cleaner (we can do logic
without having a full page refresh), but if that is not guaranteed, we
should be able to tell the container exactly what to do after their
page refreshes.
Further more, we should be able to ask the container (through features/
capabilities function), if they support full javascript callback, or
if they only support the full page refresh.. (then we can decide to
pass in the navigateTo parameters, or a callback function )...
Am I making any sense? Ideas? Questions?
1) to allow apps for clean control of use cases and unique user
workflows:
I propose to create a new object NavigateToParams; currently would
contain view and params.
I propose to change requestShareApp to allow it to take in an optional
NavigateToParams for "postInvite" and "postInviteAccept" and a
JavascripCallback for postInvite ( or i would prefer to do that
through normal DataResponse callbacks ).
I propose that these changes be considered for requestSendMessage and
any other method that might require the container to have to change
pages.
2) to allow easy way for apps to simply track invites sent and invites
accepted ( maybe for point rewards, etc )
I propose to add more ping urls for invites sent and invites
accepted. :)
( this is so apps can have different ways to track information,
without having to complicate the workflow and pages they have to
maintain ).
On Apr 14, 6:12 pm, Evan Gilbert <
uid...@google.com> wrote:
> Definitely works to have one response per user. Possibly more generally we
> could have responseItem.getErrors(), which can return 0-n errors with a
> given request (this is also useful for use cases such as form validation,
> where a user might have invalid values in multiple fields). This could also
> have arbitrary key / value maps along with each error.
>
> Rough sample code:
> var errors = responseItem.getErrors();
> for (var i = 0; i < errors.length; i++) {
> var error = errors[i].
> if (error.getErrorCode() == opensocial.ResponseItem.Error.FORBIDDEN) {
> var userid = error.getParam('userid');
> handleMailNotSent(userid);
> }
>
> }
>
> Evan
>