Share the image on the wall FB

I have an image in my application that I want to split into FB.

Now I have an FB application installed on my iPhone.

What I want, when I click on the image sharing of my application, then it should open the FB application and allow me to share my image there.

Can I share an image in our application through an external FB application?

The same for twitter and related?

solvable This has been resolved using ShareKit. The only thing you could not directly send the image to twitter. Therefore, you need to upload the image to your server and send this URL to twitter. Rocks Sharekit

0
source share
3 answers

https://github.com/ShareKit/ShareKit

Try using sharekit, this is useful. Follow all steps, and if there is a request, than a message back

+1
source

add FBConnect to your project and use the code below for general image capture on facebook. Also add the delegate FBSessionDelegate, FBDialogDelegate, FBRequestDelegate to your .h file. If you want to share a local image, you do not need to upload the image to the server. pass uiimage object to facebook settings.

if (facebook == nil) { facebook = [[Facebook alloc] initWithAppId:@"your facebook key "]; } NSArray* permissions = [NSArray arrayWithObjects: @"publish_stream", @"offline_access", nil] ; // [facebook authorize:permissions delegate:self]; - (BOOL) takeScreenshot { UIGraphicsBeginImageContext(self.view.frame.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: viewImage,@"message", nil]; [facebook requestWithGraphPath:@"me/photos" // or use page ID instead of 'me' andParams:params andHttpMethod:@"POST" andDelegate:self]; return YES; } #pragma mark - #pragma mark FBSessionDelegate /** * Called when the user has logged in successfully. */ - (void)fbDidLogin { isFBLogged = YES; [self takeScreenshot]; if([self takeScreenshot]) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Image share sucessfully" message: nil delegate: nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Image share unsucessfully" message: nil delegate: nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; } } 
0
source

Source: https://habr.com/ru/post/1433377/


All Articles