gpt4 book ai didi

iphone - FBWebDialogs presentRequestsDialogModallyWithSession 不工作?

转载 作者:行者123 更新时间:2023-11-28 22:26:54 24 4
gpt4 key购买 nike

此代码不会在 friend 端生成通知。但发送成功不会产生任何错误。我正在为 friend 构建游戏 url 的应用程序以邀请他们玩。我在下面编写了发送 url 的代码。它工作正常,但没有没有生成错误,但用户没有收到任何应用程序请求。

        //Fbwebdialog  generating no error
[FBWebDialogs presentRequestsDialogModallyWithSession:[FBSession activeSession]
message:[NSString stringWithFormat:@"I just smashed friends! Can you beat it?"]
title:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Case A: Error launching the dialog or sending request.
NSLog(@"Some errorr: %@", [error description]);
UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Invitiation Sending Failed" message:@"Unable to send inviation at this Moment, please make sure your are connected with internet" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alrt show];
} else {
if (![resultURL query]) {
return ;
NSLog(@"User canceled request.");
} else {
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"]);
NSArray *requestIDs=[params objectForKey:@"request"];

}
if ([recipientIDs count] > 0){

//[self showMessage:@"Sent request successfully."];
//NSLog(@"Recipient ID(s): %@", recipientIDs);

// punGameViewController *pun=[[punGameViewController alloc]initWithNibName:@"punGameViewController" bundle:nil];

UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"Successfully send" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alrt show];

// [self.navigationController pushViewController:pun animated:YES];



}

}
}

}];
//end of code here

检查它找出不生成通知的原因。

最佳答案

我在之前回答的 S/O 问题上找到了这个问题的答案。基本上,您需要在 Facebook 应用程序设置中设置 App Store Id 和 Bundle Id 才能发送邀请。您可以找到该信息:here

关于iphone - FBWebDialogs presentRequestsDialogModallyWithSession 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18696401/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com