tags:

views:

105

answers:

0

HI everyone

I have successfully connect to facebook directly on the result screen of my game. But that's not what I want, I want to publish the scores right after I log in. Below is my code of publish the feed. But how do I trigger this function to make it run? I saw the example on Cocoa. But now i apply it on Cocos2D. There are few warnings too, such as "WinningLayer does not implement "FBSessionDelegate" prototol". What does that mean? PLease help me out with this. Many thanks

- (void)publishFeed:(id)target 
{
    NSString *path = [NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle] resourcePath],@"/menu_button_2.wav"];
    SystemSoundID soundID;
    NSURL *filePath = [NSURL fileURLWithPath:path isDirectory :NO];
    AudioServicesCreateSystemSoundID((CFURLRef)filePath ,&soundID);
    AudioServicesPlaySystemSound(soundID);
    [path release];

    FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
    //dialog.delegate = self;
    dialog.userMessagePrompt = @"Le dégrafeur";
    dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"%@ played « Game: Haha », and proved that he/she got a real smooth hand…\",\"caption\":\"%@ is able to open 10 boxes in 30 seconds with just one hand! Now that’s a skilled opener…\",\"description\":\" See if you can do better than %@ by playing « Game: Haha » on iPhone and iPod Touch! Check it out here <link to the appstore>.\",\"media\":[{\"type\":\"image\",\"src\":\"http://img15.imageshack.us/img15/2365/facebookillustration.png\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Playsoft home page\",\"href\":\"http://www.Playsoft.fr\"}}}",name,name,name];
    [dialog show];
}