Hey community,
I'm using following code for facebookintegration:
Code:class MyPlayerController extends GamePlayerController; var FacebookIntegration Facebook; simulated function PostBeginPlay() { Super.PostBeginPlay(); Facebook = class'PlatformInterfaceBase'.static.GetFacebookIntegration(); if (!Facebook.IsAuthorized()) Facebook.Authorize(); } function PostToWallTest()//called from a "MenuObject" inside "MyMenuScene" below { local array<string>Params; Params.AddItem("message"); Params.AddItem("Shouldn't see this"); Params.AddItem("link"); Params.AddItem("www.google.com"); Params.AddItem("picture"); Params.AddItem("http://yourkidsartsucks.com/wp-content/uploads/2011/10/Funny_Art_223.jpg"); Facebook.FacebookDialog("feed", Params); }
Code:class MyMenuScene extends MobileMenuScene; event OnTouch(MobileMenuObject Sender, ETouchType EventType, float TouchX, float TouchY) { if (Sender == none) return; if (EventType != Touch_Began) return; if (Sender.Tag == "FACEBOOKTEST") { MyPlayerController(InputOwner.Outer).PostToWallTest(); return; } return; } defaultproperties { SceneCaptionFont=MultiFont'CastleFonts.Positec' //bRelativeLeft=true bRelativeTop=true bRelativeWidth=true bRelativeHeight=true Left=192//0.0 Top=0.0 Width=1.0 Height=1.0 Begin Object Class=MobileMenuButton Name=facebookTestButton Tag="FACEBOOKTEST" //bRelativeLeft=true //bRelativeTop=true Left=0 Top=2816 Width=128 Height=64 TopLeeway=0 Images(0)=Texture2D'MyPackage.Textures.Tex_MyButtons' Images(1)=Texture2D'MyPackage.Textures.Tex_MyButtons' ImagesUVs(0)=(bCustomCoords=true,U=0,V=256,UL=256,VL=128) ImagesUVs(1)=(bCustomCoords=true,U=0,V=256,UL=256,VL=128) End Object MenuObjects(0)=facebookTestButton }
Everything is working fine, exept that I have to push the "facebookTestButton" twice to do what's expected.
The first time the loadingscreen is popping up for a second only and when I push the button the second time,
it opens like expected and I can post a message to my wall.
Anyone got a clue what's happening here ?
Nobody complained about the code and it didn't happen anymore, so it could have been due to connection problems.



Reply With Quote

Bookmarks