1
這可能是一個簡單的問題,但任何人都可以告訴我。Facebook上的邀請好友的設置
我們需要在應用程序(在Facebook開發人員網站)爲邀請朋友做任何設置嗎?
我已經完成了所有的代碼邀請朋友。
當我替換邀請朋友正在工作的示例代碼的Facebook應用程序ID時,我的代碼也正常工作。
但是,當我替換我的APP ID後,過程進展順利,向我顯示成功的邀請郵件,但邀請不會發送。
我使用下面的代碼:
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:FacebookInviteMessage
title:@"Invite Friends"
parameters:parameters
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
NSString *strResultUrl = [resultURL absoluteString];
if (result == FBWebDialogResultDialogCompleted && ![strResultUrl isEqualToString:@"fbconnect://success"])
{
MIDLog(@"Web dialog complete: %@", resultURL);
if (![resultURL query])
{
return;
}
NSDictionary *params = [self parseURLParams:[resultURL query]];
NSMutableArray *recipientIDs = [[NSMutableArray alloc] init];
for (NSString *paramKey in params)
{
if ([paramKey hasPrefix:@"to["])
{
[recipientIDs addObject:[params objectForKey:paramKey]];
}
}
if ([params objectForKey:@"request"])
{
NSLog(@"Request ID: %@", [params objectForKey:@"request"]);
}
if ([recipientIDs count] > 0)
{
//[self showMessage:@"Sent request successfully."];
//NSLog(@"Recipient ID(s): %@", recipientIDs);
UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"Invitation(s) sent successfuly!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alrt show];
alrt = nil;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success" message:FacebookInviteSuccess delegate:self cancelButtonTitle:@"Proceed" otherButtonTitles:nil];
alert.tag = 14114;
[alert show];
alert = nil;
}
else if (result == FBWebDialogResultDialogCompleted && [strResultUrl isEqualToString:@"fbconnect://success"])
{
MIDLog(@"Cancel Clicked");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Cancelled" message:nil delegate:self cancelButtonTitle:@"Proceed" otherButtonTitles:nil];
alert.tag = 14114;
[alert show];
alert = nil;
}
else {
MIDLog(@"Web dialog not complete, error: %@", error.description);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:InternetFailError delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
alert.tag = 15115;
[alert show];
alert = nil;
}
}
friendCache:self.friendCache]