ActionScript 3 Facebook API Limitations

I am building a Flash Connect (AS3) -based Facebook Connect site using the ActionScript 3 API, and although I have the basic FB Connect functionality that allows users to log in correctly, I run into walls when trying to request certain advanced permissions. I'm not sure, but it seems that there are two pretty significant limitations to the AS3 API:

  • You must request advanced permissions separately from the initial login. In other words, two modal dialogs are needed, not one. This seems to be due to the fact that the connection is being processed with instances of FacebookSessionUtil, and the extended permission requests are being processed by instances of FacebookSessionUtil.Facebook.

  • There seems to be no way to suggest users to allow sharing their email address with your application. Although I looked at the http://facebook-actionscript-api.googlecode.com/svn/release/current/docs/index.html in quite some detail , it seems that the "EMAIL" permission there only offers users to allow the application to send their email via facebook to not send your email address directly.

Are my assumptions wrong here? Would I be better off using JS and ExternalInterface for this kind of work? I would prefer not to rebuild what is in place, but if these restrictions are real, it seems that I will have no other choice.

Any feedback or help is appreciated. Thank!

+3
2

1) onLogin DesktopSession .

2) , . facebook , .

api

<button id="fb-login">Login &amp; Permissions</button>

<script>
document.getElementById('fb-login').onclick = function() {
  var cb = function(response) {
    Log.info('FB.login callback', response);
    if (response.session) {
      Log.info('User logged in');
      if (response.perms) {
        Log.info('User granted permissions');
      }
    } else {
      Log.info('User is logged out');
    }
  };
  FB.login(cb, { perms: 'email' });
};
</script>
+1

AS3 ( )

im, facebook, . . ( , channel.html oauth: true init)

, API ( 1.7) (http://code.google.com/p/facebook-actionscript-api)

private function facebookInit():void     // START THE SESSION{
    Facebook.init(APP_ID, facebookInitHandler,{
        appId: APP_ID,
        status: true,
        cookie: true,
        xfmbl: true,
        channelUrl: ‘http://yoursiteurl/channel.html',
        oauth: true,
        perms: "publish_stream,email"
    });
}

private function facebookInitHandler(response:Object, fail:Object):void
{
    if (response.accessToken)
    {
        userAccessToken = JSON.encode(response.accessToken);
        facebookLoggedInWithToken = true;
        loadProfileData();
    } else {
        facebookLoggedInWithToken = false;
    }
}

private function loadProfileData():void
{
    var request:String = ‘/me’;
    var requestType:String = ‘GET’;
    var params:Object = null;
    Facebook.api(request, loadProfileDataHandler, params, requestType);
}

private function loadProfileDataHandler(response:Object, fail:Object):void
{
    if (response) {
        userID = response.id;
        fullName = response.name;
        firstName = response.first_name;
        lastName = response.last_name;
        userEmail = response.email;
        userPicURL = ‘http://graph.facebook.com/‘ + userID + ‘/picture’;
    }
}

!

+1

Source: https://habr.com/ru/post/1752075/


All Articles