1
사용자가 FBdialogs를 사용하여 친구에게 요청을 보낼 수있는 하나의 게임을 만들고 있습니다. 다음 코드를 사용하고 있습니다.Objective c에서 FBWebDialogs를 사용하여 요청을 보내는 방법
NSError *error;
NSData *jsonData = [NSJSONSerialization
dataWithJSONObject:@{
@"social_karma": @"5",
@"badge_of_awesomeness": @"1"}
options:0
error:&error];
if (!jsonData) {
NSLog(@"JSON error: %@", error);
return;
}
NSString *giftStr = [[NSString alloc]
initWithData:jsonData
encoding:NSUTF8StringEncoding];
NSMutableDictionary* params = [@{@"data" : giftStr} mutableCopy];
// Display the requests dialog
[FBWebDialogs
presentRequestsDialogModallyWithSession:nil
message:@"Learn how to make your iOS apps social."
title:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or sending the request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(@"User canceled request.");
} else {
// Handle the send request callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"request"]) {
// User clicked the Cancel button
NSLog(@"User canceled request.");
} else {
// User clicked the Send button
NSString *requestID = [urlParams valueForKey:@"request"];
NSLog(@"Request ID: %@", requestID);
}
}
}
}];
이 코드는 요청한 사용자에게 요청을 성공적으로 보내고 요청 ID를 표시합니다. 하지만 친구 업데이트를 체크인 할 때. 업데이트 중 요청을 표시하지 않습니다.
이 코드에서 어떤 점이 잘못되었는지 말해 줄 수 있습니까? 또는 친구에게 요청을 보내는 다른 방법이 있습니까?
감사합니다, 은 그러나 나는 또한 내가 내 응용 프로그램의 Info.plist에 APPID을 확인 크로스가 아이폰 OS 설정이 완벽 있음을 크로스 체크가 있습니다. 그것은 또한 정확합니다. 또한 샌드 박스 모드가 꺼져 있습니다. 다른 것이 남아 있다고 말해주세요. –
모바일 oor 웹에서 초대를 확인하고 있습니까? –
나는 내 모바일뿐만 아니라 웹에서도 확인 중입니다 –