我必须将应用程序请求集成到我的应用程序中,但它似乎不起作用。我搜查了一下,但找不到明确的答案。报告中的一些回复表示,该请求可在Facebook App Center中找到,但我没有收到任何请求,也没有收到任何通知。我使用Facebook SDK for iOS v3.8
来发送请求。没有错误,并且有一个请求,它总是成功,但仍然没有通知。iOS:没有收到来自Facebook应用程序请求的通知
这是我用来发送请求的代码。
- (void)sendAppInvite:(NSString *)message {
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"app_non_users", @"filters", nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:[FBSession activeSession] message:message title:nil parameters:params handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Case A: Error launching the dialog
NSLog(@"Error on app invite.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// Case B: User clicked the "x" icon
NSLog(@"User canceled app invite");
} else {
// Case C: Dialog shown and the user clicks Cancel or Share
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"request"]) {
// User clicked the Cancel button
NSLog(@"User canceled app invite");
} else {
// User clicked the Send button
NSString *postID = [urlParams valueForKey:@"request"];
NSLog(@"Request successful: %@", postID);
}
}
}
}];
}
我也试过从Facebook
构建示例应用程序,我发了个邀请。不过,没有通知,也没有来自应用中心的请求。
有什么我做错了吗?另外,有没有从Facebook Request
的错误?
谢谢!
您是否知道这一点?我有同样的问题。 – Harish
我真的不知道发生了什么事。我上周再次测试了它,并且我的朋友看到了这个请求,尽管不是在通知中,而是在应用中心。 – dzep
是的,那是对的。我意识到我的通知已发送到App Center – Harish