Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 我们如何使用FB登录来创建url?_Iphone_Facebook_Facebook Like - Fatal编程技术网

Iphone 我们如何使用FB登录来创建url?

Iphone 我们如何使用FB登录来创建url?,iphone,facebook,facebook-like,Iphone,Facebook,Facebook Like,我想使用给定链接中显示的like按钮来喜欢url 单击“喜欢”按钮将喜欢此页面,并显示在活动块下的facebook个人资料页面中,如下所示: 我们怎么会喜欢iPhone应用程序中的url呢?如果用户是用fb登录的,那么就像如果不登录,那么登录,然后像 提前谢谢。你在找这个吗:你在找这个吗:最后,我完成了 使用graph API喜欢页面URL的代码如下: - (IBAction)likepageonFB:(id)sender { [appDelegate openSession

我想使用给定链接中显示的like按钮来喜欢url

单击“喜欢”按钮将喜欢此页面,并显示在活动块下的facebook个人资料页面中,如下所示:

我们怎么会喜欢iPhone应用程序中的url呢?如果用户是用fb登录的,那么就像如果不登录,那么登录,然后像


提前谢谢。

你在找这个吗:

你在找这个吗:

最后,我完成了

使用graph API喜欢页面URL的代码如下:

    - (IBAction)likepageonFB:(id)sender
{
    [appDelegate openSession];

     NSString *likePage=@"http://www.facebook.com/ipreencekmr";

    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);
    }];
}

你可以查看我上传的这个例子。最后,我完成了

使用graph API喜欢页面URL的代码如下:

    - (IBAction)likepageonFB:(id)sender
{
    [appDelegate openSession];

     NSString *likePage=@"http://www.facebook.com/ipreencekmr";

    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);
    }];
}
你可以检查我上传的这个例子