how to share a Photo Or link on facebook wall without using FBSDKShareDialog from native ios app

Hiren kanetiya

I want to post some photos Or Link on user Facebook wall without using FBSDKShareDialog . I am already post With using the FBSDKSharePhoto And FBSDKShareDialog default dialog from facebook. for that I do the below code

FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = self.imgView.image;
photo.userGenerated = YES;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[photo];
[FBSDKShareDialog showFromViewController:self
                             withContent:content
                                delegate:(id)self];

But, this code open the Default FB dialog. So, how can I directly post the link and photos ON user's wall.

Ashish Kakkad

You can use SLComposeViewController of default iOS Social Framework

#import <Social/Social.h>

- (IBAction)postToFacebook:(id)sender {
    if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {

        SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

        [controller setInitialText:@"Post from my iPhone app"];
        [controller addURL:[NSURL URLWithString:@"http://www.yourlink.com"]];
        [controller addImage:[UIImage imageNamed:@"facebook-image.jpg"]];
        [controller setCompletionHandler:^(SLComposeViewControllerResult result) {

        switch (result) {
             case SLComposeViewControllerResultCancelled:
                 NSLog(@"Post Canceled");
                 break;
             case SLComposeViewControllerResultDone:
                 NSLog(@"Post Sucessful");
                 break;

             default:
                 break;
         }
        }];
        [self presentViewController:controller animated:YES completion:Nil];

    }
}

Documentation for Facebook Sharing. : https://developers.facebook.com/docs/sharing/ios

Through Graph API :

1) Post image on facebook wall using graph api iphone sdk

2) Photo Upload to own wall via iOS Graph API with user's location

3) http://www.raywenderlich.com/1488/facebook-tutorial-for-ios-how-to-use-facebook-new-graph-api-from-your-iphone-app

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to post href link to facebook wall in objective c

分類Dev

Open app from Facebook link

分類Dev

Facebook iOS SDK 4.0 "App Invites" sent without iOS notification

分類Dev

How do you post to a friend's wall using the C# Facebook SDK?

分類Dev

Building iOS Native App using WebRTC

分類Dev

How to make my app appear in share list in vue native?

分類Dev

Is it possible to share images from my ios app with instagram ?

分類Dev

How to get cycling duration from HealthKit for ios app using Swift

分類Dev

iOS: Is it possible to get iTunes app link from iOS application programmatically?

分類Dev

Share Image in Facebook using SLComposeViewController

分類Dev

Facebook SDKのFBSDKShareDialogがiOS9で動作していませんか?

分類Dev

iOS 8.3 and later, Facebook share text not inserted

分類Dev

How do I share an image on iOS and Android using Flutter?

分類Dev

How post to wall facebook android-sdk:4.0.0

分類Dev

How post to wall facebook android-sdk:4.0.0

分類Dev

How to get the friends' posts on a facebook user's wall

分類Dev

How to completely Logout of Facebook SDK Auth in iOS App

分類Dev

Writing a comment onto a 3rd party facebook wall via website link

分類Dev

can people see Facebook IOS app on their facebook?

分類Dev

iOS: Login to Facebook through app

分類Dev

Facebook share count from debugger page

分類Dev

Facebook FBSDKAppInviteContent - Missing App Link URL

分類Dev

How to delete an app from iOS Xcode Simulator?

分類Dev

How to delete an app from iOS Xcode Simulator?

分類Dev

How to completely remove app from iOS?

分類Dev

I can access iOS Photo Library without requesting permission

分類Dev

how to simulate the click event on the facebook share button

分類Dev

How to create an IOS app that could install without the Apple Store?

分類Dev

How can I share an Image to my Cordova/PhoneGap App from another App?

Related 関連記事

  1. 1

    How to post href link to facebook wall in objective c

  2. 2

    Open app from Facebook link

  3. 3

    Facebook iOS SDK 4.0 "App Invites" sent without iOS notification

  4. 4

    How do you post to a friend's wall using the C# Facebook SDK?

  5. 5

    Building iOS Native App using WebRTC

  6. 6

    How to make my app appear in share list in vue native?

  7. 7

    Is it possible to share images from my ios app with instagram ?

  8. 8

    How to get cycling duration from HealthKit for ios app using Swift

  9. 9

    iOS: Is it possible to get iTunes app link from iOS application programmatically?

  10. 10

    Share Image in Facebook using SLComposeViewController

  11. 11

    Facebook SDKのFBSDKShareDialogがiOS9で動作していませんか?

  12. 12

    iOS 8.3 and later, Facebook share text not inserted

  13. 13

    How do I share an image on iOS and Android using Flutter?

  14. 14

    How post to wall facebook android-sdk:4.0.0

  15. 15

    How post to wall facebook android-sdk:4.0.0

  16. 16

    How to get the friends' posts on a facebook user's wall

  17. 17

    How to completely Logout of Facebook SDK Auth in iOS App

  18. 18

    Writing a comment onto a 3rd party facebook wall via website link

  19. 19

    can people see Facebook IOS app on their facebook?

  20. 20

    iOS: Login to Facebook through app

  21. 21

    Facebook share count from debugger page

  22. 22

    Facebook FBSDKAppInviteContent - Missing App Link URL

  23. 23

    How to delete an app from iOS Xcode Simulator?

  24. 24

    How to delete an app from iOS Xcode Simulator?

  25. 25

    How to completely remove app from iOS?

  26. 26

    I can access iOS Photo Library without requesting permission

  27. 27

    how to simulate the click event on the facebook share button

  28. 28

    How to create an IOS app that could install without the Apple Store?

  29. 29

    How can I share an Image to my Cordova/PhoneGap App from another App?

ホットタグ

アーカイブ