0

我正在使用 facebook action script 3 SDK 使用 Adob​​e AIR + 为 Android 编写应用程序。我可以在 Android 手机上向用户显示标准 apprequest 对话框吗?

FB.ui({method: 'apprequests', message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});

如何从 facebook action script 3 SDK 调用它?谢谢!

4

1 回答 1

1

看看这个脚本,回答你的问题

如何从 facebook action script 3 SDK 调用它?

private function inviteFriends():void
{
    var dat:Object = new Object();
    dat.message = "Let's invite friends for our Super Extra Max Facebook App, more info go to http://blog.ukasz.com";
    dat.title   = 'Super Extra Max Facebook App';
    // filtering for non app users only
    dat.filters = ['app_non_users'];
    //You can use these two options for diasplaying friends invitation window 'iframe' 'popup'
    Facebook.ui('apprequests', dat, onUICallback, 'popup');
}

这是处理程序

private function onUICallback(result:Object):void{
    if(result == null){
         trace('User closed the pop up window without inviting any friends');
         return
    }
    var invitedUsers:Array  = new Array();
    invitedUsers = result.request_ids as Array;
    trace('You Have Invited ', invitedUsers.length,' friends');
    //Simple if else if you want user to invite certain amount of friends
    if(invitedUsers.length > 1){
        trace('GREAT, USER IS GENERATING TRAFFIC');
    }else{
        trace('No Good, User invited only one friend.');
    }
}

感谢卢卡斯

于 2011-09-22T22:59:41.280 回答