我正在尝试将 1.6 Mobile Facebook API ( http://code.google.com/p/facebook-actionscript-api/downloads/detail?name=GraphAPI_Mobile_1_6.swc ) 实现到 Air for Android 应用程序中。我已经成功地使用了 Web 和桌面 API,但是对于移动应用程序,它期望 stageReference 有一个额外的参数,请参阅:
login(callback:Function, stageRef:Stage, extendedPermissions:Array, webView:StageWebView = null)
但是,使用我使用的是 Flex 而不是 Flash CS5,我不能只通过 this.stage 或 this 或类似的东西。
你们认为我需要使用 Flash builder Flex 传递什么?我似乎找不到移动操作脚本 API 的任何示例,所以我有点不知所措,有人有什么想法吗?
以下是来自 Mobile API Docs 的登录信息:
login () method
public static function login(callback:Function, stageRef:Stage, extendedPermissions:Array, webView:StageWebView = null):void
Opens a new login window so the current user can log in to Facebook.
Parameters
callback:Function — The method to call when login is successful. The handler must have the signature of callback(success:Object, fail:Object); Success will be a FacebookSession if successful, or null if not.
stageRef:Stage — A reference to the stage
extendedPermissions:Array — (Optional) Array of extended permissions to ask the user for once they are logged in.
webView:StageWebView (default = null) — (Optional) The instance of StageWebView to use for the login window For the most current list of extended permissions, visit http://developers.facebook.com/docs/authentication/permissions