1

私はFacebookのようなボタンのないFacebookページのようなものに取り組んでいます。私のアプリケーションでは。

次のコードを使用して、アプリケーションからページを気に入っています。

以下はFacebookのように追加したいページのURLです。

NSString *likePage=@"https://www.facebook.com/pages/Shaktimantelecom/265306070277816?ref=hl"; // here you page url

以下は、FaceBookRequestConnection私のアプリケーションからページを好きにする私のクラスです。

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   likePage, @"object",[[NSUserDefaults standardUserDefaults] valueForKey:@"token"],@"access_token",
                                   nil];
[FBRequestConnection startWithGraphPath:@"/me/og.likes" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
        UIAlertView *alert=[[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:@"liked with id %@",[result valueForKey:@"id"]] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
        [alert show];
        NSLog(@"result is %@",result);
    }];

上記のコードを使用すると、エラーが発生し"The operation couldn't be completed (com.facebook.sdk error 5)"ます。

私が何か間違ったことをしていないかどうか教えてください。

Note: I am using Facebook sdk.
4

0 に答える 0