crusy.net

  • home.
  • photos.
  • about.

 

21
May

Facebook Actionscript API und Extended Permissions

By crusy|Coding, Flash|Be the first to comment!

Die Facebook Actionscript API ist schön und gut (sic!), aber sehr schlecht dokumentiert. Ein Beispiel? Die Klassen com.facebook.commands.stream.* existieren, stehen aber nicht in der Doku^^

Von daher hat es etwas gedauert, um das folgende Problem zu identifizieren: Wenn man sich per Connect bei Facebook einloggt, können Extended Permissions direkt beim Login abgefragt werden (Parameter req_perms). Die AS API bietet dies aber nicht an; in der Klasse com.facebook.session.DesktopSession (Funktion onLogin()) werden sie zwar verwendet, aber man kann keine eigene Auswahl festlegen. Also: Sourcen runterladen, ändern:

protected function onLogin(p_event:FacebookEvent):void {
p_event.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);

if (p_event.success) {
_auth_token = (p_event.data as StringResultData).value;

//now that we have an auth_token we need the user to login with it
var request:URLRequest = new URLRequest( login_url );
var variables:URLVariables = new URLVariables();

variables.req_perms = ExtendedPermissionValues.PUBLISH_STREAM;
variables.api_key = api_key;
variables.v = api_version;
variables.auth_token = _auth_token;

request.data = variables;
navigateToURL(request, “_blank”);

_waiting_for_login = true;
dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
} else {
onConnectionError(p_event.error);
}
}

Der wichtige Punkt hier ist es, URLVariables zu verwenden!

Quelle, ich musste aber zwei Parameter entfernen, um es zum Laufen zu kriegen.

HTH

Tagged as: Actionscript, API, Connect, Desktop Session, Extended Permission, Facebook, Google Code
Add your comment →

0 Comments

Leave your comment below! Cancel Reply

View More Posts:
  • ←
  • →

Suche:

Schubladen:

  • Apropos (55)
  • Computer (210)
    • Arduino (3)
    • Coding (156)
      • CSS (5)
      • Flash (87)
      • Java (2)
      • Javascript (17)
      • PHP (5)
    • Firefox (18)
    • OS X (18)
  • Lustig (86)
  • Musik (50)
  • Photo (30)
    • Photoshop (16)
  • Video (57)
  • Web (94)
  • Werbung (28)

@crusy:

;-)
2 days ago from web
>:-( http://t.co/vIHOSNUQ
2 days ago from web
RT @titanic: Steinbach twittert weiter http://t.co/ICvEIG9B
2 days ago from twitterfeed
PS: Nach dem letzten Tweet darf ich nicht mehr in die Staaten einreisen :-/
2 days ago from web
"American Die" #Filmkrankheiten
2 days ago from web

Kommentare:

  • crusy on Arduino mit Eclipse als IDE
  • michael on Arduino mit Eclipse als IDE
  • crusy on AIR Native Extension für Arduino
  • Arduino Development in Eclipse under OSX | enterfra.me | Sebastian Telschow on Arduino mit Eclipse als IDE
  • Werbung: Microsoft Songsmith - meetinx on OMG

Tags:

Actionscript Actionscript 3 Addon Adobe AIR Apple AS AS3 Coding Comment Cover CSS Eclipse Facebook FDT Fehlermeldung Film Firefox Flash Flex Font Google Internet iOS iPad iPhone Javascript Kommentar Kunst Mac music Musik Obama OSX OS X Photoshop PHP Plugin Star Wars Video Web Werbung Wordpress XML Youtube

Projekte

  • Bent Larsen
    DAS Film Noir Point-and-Click-Adventure
  • crusy goes sf
    Photoblog aus San Francisco
  • Insignia
    Aufbau. Handel. Herrschaft.
  • nerdeln.de
    Nörgeln für Nerds
  • Photos
    Mein Photoblog
  • Tourtagebuch
    Von sechs Menschen, einer Stadt und keiner Wohnung

Powered by the inLine Minimal WordPress Theme