Hi, You should be calling these APIs after the gadgets API has initialized.
Please register a callback with gadgets.util.registerOnLoadHandler(callback) and call postActivity from the callback. Thanks, Shishir On Mon, Mar 22, 2010 at 12:44 AM, Maximus mano <[email protected]>wrote: > Hi Shishir, > > I tried your code, but the result in same error: > "There was a problem: forbidden: Create activity permission denied." > > My XML Code: > http://hosting.gmodules.com/ig/gadgets/file/112288039785097379866/sacts.xml > > > > On Sun, Mar 21, 2010 at 3:30 PM, Shishir Birmiwal (Google) < > [email protected]> wrote: > >> Hi, >> >> I just tried this again on sandbox and on orkut.com. I used the sample >> code orkut-developer-app for posting an activity. >> It worked just fine. Is this problem still present? >> >> function onActivityPosted(data) { >> if (data.hadError()) { >> alert("There was a problem: " + data.getErrorMessage()); >> } else { >> output("The activity was posted successfully."); >> } >> }; >> >> function postActivity(title, body) { >> var data = {}; >> data[opensocial.Activity.Field.TITLE] = title; >> data[opensocial.Activity.Field.BODY] = body; >> var activity = opensocial.newActivity(data); >> opensocial.requestCreateActivity( >> activity, >> opensocial.CreateActivityPriority.LOW, >> onActivityPosted >> ); >> }; >> >> postActivity("This is a sample activity", "This is an activity body"); >> >> >> >> Thanks, >> Shishir >> >> On Sun, Mar 14, 2010 at 10:56 PM, Luiz Carvalho >> <[email protected]>wrote: >> >>> I'm having the same problem! >>> >>> >>> >>> >>> On 12 mar, 03:04, "Prashant (Google)" <[email protected]> wrote: >>> > Hi Minhao, >>> > >>> > Yes, you're right, I ran into the same issue. I'll file a bug and >>> > update you when I find a solution. >>> > >>> > ~Prashant >>> > >>> > On Mar 11, 1:02 pm, Minhao <[email protected]> wrote: >>> > >>> > > Hi there, >>> > >>> > > I am facing a strange problem: >>> > >>> > > when I try to create an activity, I constantly get some error saying: >>> > >>> > > "forbidden: Create activity permission denied." >>> > >>> > > My codes look like: >>> > >>> > > var params = {}; >>> > > params[opensocial.Activity.Field.TITLE] = feed_title; >>> > > params[opensocial.Activity.Field.BODY] = feed_content; >>> > > var activity = opensocial.newActivity(params); >>> > >>> > > alert(opensocial.hasPermission(opensocial.Permission.VIEWER)); >>> > >>> > > opensocial.requestCreateActivity(activity, >>> > > opensocial.CreateActivityPriority.LOW, >>> > > function(responseStatus) >>> > > { >>> > > if(responseStatus.hadError()) >>> > > { >>> > > alert(responseStatus.getErrorMessage()); >>> > > } >>> > > else >>> > > { >>> > > // publishing success >>> > > } >>> > > } >>> > > ); >>> > >>> > > More weird is that checking opensocial.hasPermission() tells me >>> > > "true". >>> > >>> > > I could recall that this function actually did work for me a few days >>> > > back. So am wondering if anyone is facing the same kind of problem? >>> > > Maybe this could be due to the new safety change? If so, could >>> anybody >>> > > kindly prompt how I can publish a new feed in sandbox now? >>> > >>> > > I really appreciate your time and look forward to any reply. >>> > >>> > > Regards, >>> > > Minhao >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Orkut Developer Forum" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<opensocial-orkut%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/opensocial-orkut?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Orkut Developer Forum" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<opensocial-orkut%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/opensocial-orkut?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Orkut Developer Forum" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<opensocial-orkut%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/opensocial-orkut?hl=en. > -- You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en.

