我正在使用送奶工游戏中的 GoViral ANE。该扩展程序似乎正确连接到 facebook。它与我的个人资料有关。我可以看到我的个人资料图片,并收到提示,询问我是否想将 fb 与我的个人资料联系起来。整个过程没有错误。当我选择邀请朋友时,我可以看到我的朋友列表。当我向他们发送邀请时,他们永远不会收到通知。它也不会显示“喜欢”的页面。当我尝试显示粉丝页面/类似页面时,fb 加载并说找不到数据。在 fb 设置中,我将单点登录设置为是。我也将深度链接设置为是。不过,我没有在 facebook 上设置这两个平台。我只设置了android平台。我不知道这是否是一个问题。但正如我所说,它正在连接我的个人资料并在尝试邀请时显示我的朋友列表。只是之后实际上并没有做任何事情。我没有收到任何错误。
if( GoViral.isSupported() ){
GoViral.create();
}else{
trace( "GoViral only works on mobile!" );
return;
}
if( GoViral.goViral.isFacebookSupported() ){
//replace 000000 with your facebook app id!
GoViral.goViral.initFacebook( "my fb id","" );
}
btn_connectFacebook.addEventListener( MouseEvent.CLICK, connectToFacebook );
GoViral.goViral.addEventListener( G VFacebookEvent.FB_LOGGED_IN,successfulLogIn );
//GoViral.goViral.addEventListener( GVFacebookEvent.FB_LOGIN_CANCELED,onFacebookEvent );
GoViral.goViral.addEventListener( GVFacebookEvent.FB_LOGIN_FAILED,logInFailed );
public function connectToFacebook(e:MouseEvent){
if(!GoViral.goViral.isFacebookAuthenticated()){
// show a connect with Facebook prompt.
// this method takes a comma separated list of facebook READ permissions as a first
// parameter. You should have at least one read permission.
// you can refer to the facebook documentation at
// http://developers.facebook.com/docs/authentication/permissions/ to determine which
// permissions your app requires.
GoViral.goViral.authenticateWithFacebook( "public_profile");
}
}
public function successfulLogIn( e:GVFacebookEvent ){
//No longer need to connect to fb
hasConnectedToFb = true;
maintenanceSO.data.need2Connect2FB = false;
connectedToFb();
GoViral.goViral.presentFacebookPageOrProfile("last digits of my fb fan page url");
GoViral.goViral.showFacebookRequestDialog(
"Play my game",
"Play this game with me!").addDialogListener(function(e:GVFacebookEvent):void {
switch(e.type)
{
case GVFacebookEvent.FB_DIALOG_CANCELED:
//log("The Invite Dialog was canceled.");
MovieClip( root ).gotoAndStop( "didntWork" );
break;
case GVFacebookEvent.FB_DIALOG_FAILED:
MovieClip( root ).gotoAndStop( "didntWork" );
break;
case GVFacebookEvent.FB_DIALOG_FINISHED:
//log("Successfully invited friends dialog:"+e.jsonData);
if(e.data.to)
{
MovieClip( root ).gotoAndStop( "didWork" );
//log("Invited these people :"+e.data.to.join(","));
}
break;
}
});
}