2012-09-24 144 views
2

我剛剛更新了Facebook框架和邀請朋友的舊代碼沒有工作(現在沒有Facebook類對象)。我用下面的代碼:邀請朋友使用新的Facebook api

 NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
    @"1", @"frictionless", 
    @"My message", @"message", 
    @"Notification", @"notification_text",nil]; 
    [self.facebook dialog:@"apprequests" andParams:params andDelegate:self]; 

是否有可能在最新的框架上顯示相同的對話框?

+0

看一看這個線程:http://stackoverflow.com/questions/14157784/can-we-invite-people-to-use-our-app-or -send-friend-request-from-the-app-via-face – NeverHopeless

回答

2

是的。示例iOS遊戲Friend Smash(https://github.com/fbsamples/ios-friend-smash)使用此技術。等效代碼是在這裏:

https://github.com/fbsamples/ios-friend-smash/blob/master/friendsmash/friendSmasher/Game/GameController_FacebookIntegration.cpp#L365

+1

謝謝我找到解決方案。只需使用棄用的Facebook對象。我在Facebook官方指南中找到了它。 –

+0

是的,3.0 SDK旨在向後兼容(儘管有時會有更好的方法來做事) –