Inviting facebook friends in Air app for iOS

2019-07-01 16:47发布

问题:

I'm working currently on an Air app for iOS and i have some hard time trying to make "invite friends" button. I'm using facebook-actionscript-api 1.8.1 with air 3.3 and I have something like this in my code:

invite_button.addEventListener(MouseEvent.CLICK, facebookInvite);

private function facebookInvite(e:MouseEvent):void
{
    var dat:Object = new Object();
    dat.message = 'I invite you to this awesome app!';
    dat.title   = 'Super Extra Max Facebook App';
    dat.filters = ['app_non_users'];

    Facebook.ui('apprequest', dat);
}

Button displays only if user is logged in.

But when I tried to tap the button I got debugging error:

ExternalInterface not available on the device.

Well, I guess the meaning of this is obvious - it's trying to use JS.

How can I show friends select dialog and send invitations from within an app? I thought I can write some StageWebView container and display the dialog in it but isn't there some other, probably simpler way?

回答1:

Ok, so I finally found this thread on API page in issues a while ago:

http://code.google.com/p/facebook-actionscript-api/issues/detail?id=365

5th comment links to the thing I used. It appears it is just what I needed. Next time I'm just going to use native component...