blackjyn / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

Security Error #2176 when calling a post function after a callback (in Facebook.api...) #283

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an empty album:
_albumMessage = String(" ");
_albumName = String(" ");
var params : Object = {message:_albumMessage, name:_albumName};
Facebook.api('/me/albums', onEmptyAlbumCreation, params, "post");

2. after getting the id i want to upload pictures into the empty album
var bitmapData : BitmapData = _images[_uploadedPhotoNum];
_photoMessage = "message_" + _uploadedPhotoNum;
_photoFilename = "filename_" + _uploadedPhotoNum;

var params : Object = {image:bitmapData, fileName:_photoFilename};
Facebook.api(_albumID + "/photos", onSaveToPhotoAlbumComplete, params, "post");

3. error occurs.

What is the expected output? What do you see instead?
FacebookDesktop works. Facebook.api calls are failing.

What version of the product are you using? On what operating system?
OS X, Flash 10, api 1.6

SecurityError: Error #2176: Certain actions, such as those that display a 
pop-up window, may only be invoked upon user interaction, for example by a 
mouse click or button press.
    at flash.net::URLStream/load()
    at flash.net::URLLoader/load()
    at com.facebook.graph.net::FacebookRequest/loadURLLoader()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\net\FacebookRequest.as:384]
    at com.facebook.graph.net::FacebookRequest/call()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\net\FacebookRequest.as:291]
    at com.facebook.graph.core::AbstractFacebook/api()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\core\AbstractFacebook.as:119]
    at com.facebook.graph::Facebook$/api()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\Facebook.as:316]
    at eu.panasonic.viera.facebook.photoupload::PhotoCluster/createPhotoStream()[/Users/mast/Documents/workspace_fdt4/FACEBOOK_TESTS/src_int/eu/panasonic/viera/facebook/photoupload/PhotoCluster.as:77]
    at eu.panasonic.viera.facebook.photoupload::PhotoCluster/onEmptyAlbumCreation()[/Users/mast/Documents/workspace_fdt4/FACEBOOK_TESTS/src_int/eu/panasonic/viera/facebook/photoupload/PhotoCluster.as:60]
    at com.facebook.graph.core::AbstractFacebook/handleRequestLoad()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\core\AbstractFacebook.as:188]
    at com.facebook.graph.net::FacebookRequest/dispatchComplete()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\net\FacebookRequest.as:423]
    at com.facebook.graph.net::FacebookRequest/handleDataLoad()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\net\FacebookRequest.as:414]
    at com.facebook.graph.net::FacebookRequest/handleURLLoaderComplete()[C:\Users\MikeHunt\Work\facebookGraphApi\trunk\api\com\facebook\graph\net\FacebookRequest.as:392]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

PhotoCluster.as:77
Facebook.api(_albumID + "/photos", onSaveToPhotoAlbumComplete, params, "post");

PhotoCluster.as:60
calling PhotoCluster.as:77

Original issue reported on code.google.com by marc.storch@gmail.com on 30 Mar 2011 at 12:40

GoogleCodeExporter commented 9 years ago
That error means that whatever Facebook.api call you're making in 
createPhotoStream() needs to be called with user interaction...like a user 
clicking a button.

Original comment by rovertn...@gmail.com on 31 Mar 2011 at 3:51

GoogleCodeExporter commented 9 years ago
thanks for your reply. i know what the error means. i just need to call actions 
without user interaction. did anyone figure out how to deal with that?

Original comment by marc.storch@gmail.com on 31 Mar 2011 at 3:56

GoogleCodeExporter commented 9 years ago
I doubt you can get around making your call without user interaction. They 
enforce user interaction so applications can't spam users.

Original comment by rovertn...@gmail.com on 31 Mar 2011 at 4:09

GoogleCodeExporter commented 9 years ago
and they are right...hm

Original comment by marc.storch@gmail.com on 31 Mar 2011 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by rovertn...@gmail.com on 4 Apr 2011 at 8:41