UIBackButtonItem Disappears when Presenting Modal View - ios

I want my app to share something in Facebook with this code. When I am done sharing or cancelled sharing. Then it returns to my ViewController embedded in a NavigationController.
The Back bar button item disappears(somehow hidden) but still functions on all View Controllers. ,
I am using SWRevealViewController.
This is my code to present the FB share dialog:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentTitle = #"K&D Running App";
content.imageURL = [NSURL URLWithString:imageUrl];
content.contentDescription = [self getStringPost];
content.contentURL = [NSURL URLWithString:webUrl];
[FBSDKShareDialog showFromViewController: self
withContent:content
delegate:nil];

Related

FBSDKShareLinkContent without deep linking to app

I'm using FBSDKShareLinkContent to display a dialog to share a link to Facebook. No matter the link I use (I even tried with https://google.com/) when the post / link is tapped in the Facebook app my app is launched.
I want, however, to load the link in a web browser or the FB browser instead (and not have it launch my app or navigate to the app store). Is there anyway to achieve this? I tried both FBSDKShareDialogModeFeedWeb and FBSDKShareDialogModeAutomatic.
Here is my current code:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"https://google.com/"];
FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
dialog.mode = FBSDKShareDialogModeFeedWeb;
dialog.shareContent = content;
dialog.fromViewController = self;
[dialog show];
Add this to your code:
FBSDKShareLinkContent *content1 = [[FBSDKShareLinkContent alloc] init];
content1.contentURL = [NSURL URLWithString:#"http://en.wikipedia.org/wiki/Facebook"];
content1.contentTitle=#"Share";
[FBSDKShareDialog showFromViewController:self withContent:content1 delegate:nil];

Facebook share with default status post

In one of our app, we are supposed to give an option to share newly unlocked Achievement. Requirement also includes to post defined text if share box is empty.
The problem is, we are unable to find relevant delegate method when user clicks on POST/Send button.
Code for posting status is,
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:awardToBeShareOnFB];
content.contentTitle = #"Helloworld";
content.contentDescription = #"Helloworld";
[FBSDKShareDialog showFromViewController:[self parentViewController]
withContent:content
delegate:self];
It should post "Helloworld" as a status if posting box is empty.

How to share posts on Facebook and deep link to my iOS app

I'm trying to implement deep linking in my iOS app, so far I can post to my wall but only posts that are really links that goes to google.com (obviously this is a test link). I want the user to be navigated to my app when clicking on the post through the Facebook app, please I need a step by step guide cause Facebook documentation about its a little bit complicated. Here's my code:
- (void)shareOnFacebookWithName:(NSString *)contentTitle withDescription:(NSString *)contentDescription withLink:(NSString *)contentURL withPictureLink:(NSString *)imageURL andViewController:(UIViewController*)viewController{
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:contentURL];
content.contentTitle = contentTitle;
content.imageURL = [NSURL URLWithString:imageURL];
content.contentDescription = contentDescription;
[FBSDKShareDialog showFromViewController:viewController
withContent:content
delegate:self];
}

FBSDKMessageDialog for iOS doesn't work

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:APPSTORE_URL_MAIN];
content.contentTitle = INVITE_TITLE;
content.imageURL = [NSURL URLWithString:INVITE_IMG_URL];
content.contentDescription = INVITE_TEXT;
[FBSDKMessageDialog showWithContent:content delegate:self];
If the Facebook Messenger app is closed, this just opens the app and does nothing else.
Works fine is the FB Messenger app is working in background
Issue resolved by Facebook Developers.

How to Share Link on Facebook using FBSDKShareLink?

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"http://en.wikipedia.org/wiki/Facebook"];
NSURL *imageURL =
[NSURL URLWithString:#"http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg"];
content.contentDescription=#"This is facebook test";
content.contentTitle=#"Hello";
content.imageURL=imageURL;
FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init];
shareButton.shareContent = content;
shareButton.center = self.view.center;
[self.view addSubview:shareButton];
I used facebook-ios-sdk-3.24.0.pkg and I am using the above code for link sharing on facebook using fbsdksharekit. This code is working fine but after closing the xcode and reopen that xcode6.0 it shows the below error.
FBSDKCoreKit/FBSDKCoreKit.h and FBSDKShareKit/FBSDKShareKit.h not found.
i import those frameworks i.e FBSDKCoreKit/FBSDKCoreKit.h and FBSDKShareKit/FBSDKShareKit.h to viewcontroller.m file .
can any one tell me what is the problem.Thanks in advance.
Use the Below Code to Share on Facebook, download latest Facebook SDK
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:#"http://en.wikipedia.org/wiki/Facebook"];
NSURL *imageURL =
[NSURL URLWithString:#"http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg"];
content.contentDescription=#"This is facebook test";
content.contentTitle=#"Hello";
content.imageURL=imageURL;
[FBSDKShareDialog showFromViewController:self withContent:content delegate:nil];

Resources