简体   繁体   中英

Facebook Share Button for iphone

In my application i am using Facebook SDK,

I have a mark as favourite button on my view

  UIImage *favNormal = [UIImage imageNamed:@"Fav_normal"];
UIImage *favPressed = [UIImage imageNamed:@"Fav_pressed"];
[favButton setImage:favNormal forState:UIControlStateNormal];
[favButton setImage:favPressed forState:UIControlStateHighlighted];
favButton.frame = CGRectMake(0, 0, favNormal.size.width, favNormal.size.height);
//    favButton.center = CGPointMake(190, 70);
favButton.center = CGPointMake(85+(favNormal.size.width/2), 73);
[headView addSubview:favButton];

favButton.enabled = NO;
ASIFormDataRequest *request = [ProjectServerRequests ASIFormDataRequestForSrcipt:@"isFavorite"];
[request setPostValue:[NSString stringWithFormat:@"%d", Id] forKey:@"sid"];
[request setCompletionBlock:^{
    NSString *response = [request responseString];
    NSLog(@"isFavorite response: %@", response);
    if([response isEqualToString:@"yes"]) {
        [favButton setImage:[UIImage imageNamed:@"Fav_normal"] forState:UIControlStateNormal];
        [fav setImage:[UIImage imageNamed:@"Fav_pressed"] forState:UIControlStateHighlighted];
    }
    favoriteButton.enabled = YES;
}];
[request startAsynchronous];

Now i am trying to make a share button so that it should share the specific URL on Fb that is on the view, lik the view has www.my-website.com/key-chain this URL I am storing the Url in NSMutableString * url_selected

so by clicking the share button i want that it should take that particular Url and share that URL on Fb,

can any one please tell me how to coding for the Fb share button inside my application... ?

You can use share kit for FB sharing like url,text. install latest share kit & implement it.

Its easy be implemented.

如果您使用的是iOS6,请尝试使用iOS SDK中包含的社交框架以及此处提供的教程-http: //www.mobile.safilsunny.com/integrating-facebook-ios-6/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM