Hi in my Application i have option of sharing my application through Facebook. So I have added the Facebook framework to my project and I have added the bundle id into my Facebook and got the App id but the problem is I'm not Unable to share the App its showing like this.
An error occurred. Please try again later
In my Stimulator is showing like this i don't why it's showing like that. If my device have Facebook App its working fine but if it doesn't have the Facebook App its showing error like this. Please tell how to resolve this issue.
- (IBAction)share:(id)sender {
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:#"url/"];
// If the Facebook app is installed and we can present the share dialog
if ([FBDialogs canPresentShareDialogWithParams:params]) {
// Present share dialog
[FBDialogs presentShareDialogWithLink:params.link
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
// Success
NSLog(#"result %#", results);
}
}];
// If the Facebook app is NOT installed and we can't present the share dialog
} else {
// FALLBACK: publish just a link using the Feed dialog
// Put together the dialog parameters
// Put together the dialog parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"My appname", #"name",
#"test share.", #"caption",
#"sample.", #"description",
#"myrul", #"link",
nil];
// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User canceled.
NSLog(#"User cancelled.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:#"post_id"]) {
// User canceled.
NSLog(#"User cancelled.");
} else {
// User clicked the Share button
NSString *result = [NSString stringWithFormat: #"Posted story, id: %#", [urlParams valueForKey:#"post_id"]];
NSLog(#"result %#", result);
}
}
}
}];
}
}
- (NSDictionary*)parseURLParams:(NSString *)query {
NSArray *pairs = [query componentsSeparatedByString:#"&"];
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
for (NSString *pair in pairs) {
NSArray *kv = [pair componentsSeparatedByString:#"="];
NSString *val =
[kv[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
params[kv[0]] = val;
}
return params;
}
I have used the above code for its not working please help me how to resolve this issue.
Thanks.
Use this code for Share App.
-(void)facebook
{
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled) {
NSLog(#"Cancelled");
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Congratulations!" message:#"Successfully posted to facebook Wall." delegate:nil cancelButtonTitle:#"Ok" otherButtonTitles:nil, nil];
[alert show];
[Flurry logEvent:#"Share screen - Successfully posted on Facebook"];
}
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
NSString *str=[NSString stringWithFormat:#" I am using App for my iPhone. You too can download it from here"];
[controller setInitialText:str];
[self presentViewController:controller animated:YES completion:Nil];
}
else{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Sorry!"message:#"Please add Facebook account in settings menu" delegate:self cancelButtonTitle:Nil otherButtonTitles:#"Ok", nil];
alert.tag=100;
[alert show];
}
}
For use of SLComposeViewController,you have to add Social Framework. It fetch your facebook account from setting and you can share your app link through SLComposeViewController. and
if you want to add images or URL to in than :
[composeController addImage:[UIImage imageNamed:#"image.png"]];
[composeController addURL: [NSURL URLWithString:#"apple.com"]];
Related
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: #"The mechanic has done a fine job improving my vehicle…", #"name", #"Click below to download this awesome app for FREE and challenge me", #"description",iTunesLink, #"link", img, #"picture", nil];
//step 2
// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil parameters:params handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or publishing a story.
//nslog(#"Error publishing story.");
} else
{
if (result == FBWebDialogResultDialogNotCompleted)
{
// User clicked the "x" icon
//nslog(#"User canceled story publishing.");
}
else
{
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:#"post_id"])
{
// User clicked the Cancel button
//nslog(#"User canceled story publishing.");
} else
{
// User clicked the Share button
//NSString *msg = [NSString stringWithFormat: #"Posted story, id: %#", [urlParams valueForKey:#"post_id"]];
// Show the result in an alert
isSharedButtonTapped = YES;
self.btnFacebookShare.userInteractionEnabled = NO;
[[[UIAlertView alloc] initWithTitle:#"Success!" message:#"Successfully shared to Facebook" delegate:nil cancelButtonTitle:#"ok" otherButtonTitles:nil] show];
}
}
}
}];
If I'm providing the picture as "URL" its posting fine. Else its throwing error. I want to post an image that is within the application bundle. Can some on tell me where I'm coding wrong?
`NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Sharing Tutorial", #"name",
#"Build great social apps and get more installs.", #"caption",
#"Allow your users to share stories on Facebook from your app using the iOS SDK.", #"description",
#"https://developers.facebook.com/docs/ios/share/", #"link",
#"http://i.imgur.com/g3Qc1HN.png", #"picture",
nil];`
[FBDialogs presentShareDialogWithPhotoParams:params
clientState:nil
handler:^(FBAppCall *call,
NSDictionary *results,
NSError *error) {
if (error) {
} else {
//share successdialog
}
}];
You can use something like this
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *img = [info objectForKey:UIImagePickerControllerOriginalImage];
FBPhotoParams *params = [[FBPhotoParams alloc] init];
// Note that params.photos can be an array of images. In this example
// we only use a single image, wrapped in an array.
params.photos = #[img];
[FBDialogs presentShareDialogWithPhotoParams:params
clientState:nil
handler:^(FBAppCall *call,
NSDictionary *results,
NSError *error) {
if (error) {
NSLog(#"Error: %#",
error.description);
} else {
NSLog(#"Success!");
}
}];
}
For more details you can check here.
However this will add the shared image to Photos which would not be the way you want it to be. It will create a folder with the name of the app and the image will be added under this.
I'm trying to create a simple sharing function for my ios app. I wanna take advantage of the new sharing dialog (advantages like , tagging friends, add places,ecc..). What i wanna share is a photo ,a link to itunes app download, a description that comes from the ios app. I have tried the sharedialog, something like this:
NSURL *url=[[NSURL alloc] initWithString:#"https://itunes.apple.com/it/app/myapplication"];
[FBDialogs presentShareDialogWithLink:url name:#"My app name" caption:#"" description:#"prefilled descriptiontest" picture:[NSURL URLWithString:#"http://www.example.com/image.jpg"] clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
UIAlertView *av = [[[UIAlertView alloc]
initWithTitle:#"Sorry :("
message:#"There's been a problem publishing your message. Please try again!"
delegate:self
cancelButtonTitle:#"Close"
otherButtonTitles:nil] autorelease];
[av show];
} else {
// Success
UIAlertView *av = [[[UIAlertView alloc]
initWithTitle:#"Published!"
message:#"Your post has been successfully published."
delegate:self
cancelButtonTitle:#"Close"
otherButtonTitles:nil] autorelease];
[av show];
}
}];
It works but i see my prefilled description only in share dialog, when i see the shared content on facebook i only see the description taken from the linked page. So i have tried this other solution, the photodialog :
UIImage *Image=[UIImage imageNamed:#"myphoto.jpg"];
// Open the image picker and set this class as the delegate
FBPhotoParams *params = [[FBPhotoParams alloc] init];
// Note that params.photos can be an array of images. In this example
// we only use a single image, wrapped in an array.
params.photos = #[Image];
[FBDialogs presentShareDialogWithPhotoParams:params
clientState:nil
handler:^(FBAppCall *call,
NSDictionary *results,
NSError *error) {
if (error) {
NSLog(#"Error: %#",
error.description);
} else {
NSLog(#"Success!");
}
}];
In this way i can post a photo on my wall but the description parameter seems to be onlyread and i can't set any prefilled text. How i can do? There's a way to force the visualization of my description text in the sharelink dialog? Or there's a way to set a text in the photodialog? Or there another solution ?
The only solution seems to be to use only the web fallback:
NSMutableDictionary *parameter = [NSMutableDictionary dictionaryWithObjectsAndKeys:
name, #"name",
author, #"caption",
linkShare, #"link",
userImage, #"picture",
nil];
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:parameter
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error)
{
NSLog(#"Error publishing story: %#", error.description);
}
else
{
if (result == FBWebDialogResultDialogNotCompleted)
{
NSLog(#"User cancelled.");
}
else
{
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
NSLog(#"User login");
if (![urlParams valueForKey:#"post_id"])
{
NSLog(#"User cancelled post.");
}
else
{
NSString *result = [NSString stringWithFormat: #"Posted story, id: %#", [urlParams valueForKey:#"post_id"]];
NSLog(#"result %#", result);
}
}
}
}];
Building an iOS app for reading articles. I’m using Facebook SDK to share the article link and image on Facebook.
This is the process:
1.After clicking on bar button item on top right, UIActivityViewController gets opened on the bottom of the screen which gives option to share via fb, google , linked in etc.
2.On clicking the Facebook button in UIActivityVIewController, default screen opens for sharing but ideally fb SDK code should get executed.
The following "if condition” does not executed.
[AVC setCompletionHandler:^(NSString *activityType, BOOL completed)
{
if([activityType isEqualToString: UIActivityTypePostToFacebook]){
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
3.But when clicked on the cancel button of the default screen, “if condition" gets executed and app is able to share the article as expected.
Here is the code.
- (IBAction)ysshareAction:(id)sender {
NSURL *Imageurl = [NSURL URLWithString:_DetailModal1[2]];
NSData *data = [NSData dataWithContentsOfURL:Imageurl];
UIImage *image = [[UIImage alloc] initWithData:data];
NSURL *linkURL = [NSURL URLWithString:_DetailModal1[4]];//article url
NSMutableAttributedString *stringText = [[NSMutableAttributedString alloc] initWithString:_DetailModal1[0]];//_DetailModal1[0] contain article title////
[stringText addAttribute:NSLinkAttributeName value:linkURL range:NSMakeRange(0, stringText.length)];
NSArray *itemArrany = #[stringText,image,];//title is displayed but not as hyperlink.
UIActivityViewController *AVC = [[UIActivityViewController alloc] initWithActivityItems:itemArrany applicationActivities:nil];
AVC.excludedActivityTypes=#[];
[AVC setCompletionHandler:^(NSString *activityType, BOOL completed)
{
if([activityType isEqualToString: UIActivityTypePostToFacebook]){
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:#"https://www.youtube.com/watch?v=pa8lsBNG31c"];
// // If the Facebook app is installed and we can present the share dialog
if ([FBDialogs canPresentShareDialogWithParams:params]) {
// Present share dialog
[FBDialogs presentShareDialogWithLink:params.link
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
// Success
NSLog(#"result %#", results);
}
}];
// If the Facebook app is NOT installed and we can't present the share dialog
} else {
// FALLBACK: publish just a link using the Feed dialog
// Put together the dialog parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"YourStory", #"name",
_DetailModal1[0], #"caption",
_DetailModal1[4], #"link",
_DetailModal1[2], #"picture",
nil];
// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User canceled.
NSLog(#"User cancelled.");
} else {
// Handle the publish feed callback
// NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
// if (![urlParams valueForKey:#"post_id"]) {
// User canceled.
NSLog(#"User cancelled.");
// } else {
// User clicked the Share button
// NSString *result = [NSString stringWithFormat: #"Posted story, id: %#", [urlParams valueForKey:#"post_id"]];
//
}
}
}];
}
}
}];
[self presentViewController:AVC animated:YES completion:nil];
}
Any help is really appreciated.
Iam using the following code to post a message on my friend's facebook wall. This code posts message to the logged in users wall but not to the friend's wall
Iam also giving the "to" value and i.e., friends facebook id (116623456) and App_id but same problem persists.
Please provide a good direction on this.
- (void)facebookViewControllerDoneWasPressed:(id)sender
{
NSLog(#"DonePressed Called");
NSString* fid;
NSString* fbUserName;
NSString *message = [NSString stringWithFormat:#"You have been selected as a health coach(Multiple Users1), You will be receiving daily and weekly reports from here on!!!!"];
NSLog(#"Before For");
// NSString *SelectedFriends = nil;
for (id<FBGraphUser> user in _friendPickerController.selection)
{
fid = user.id;
fbUserName = user.name;
NSLog(#"User Name =%#, USer id =%#",fbUserName, fid);
}
NSLog(#"After For");
NSLog(#"%#",fid);
NSMutableDictionary *params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
#"4444444444444444",#"app_id",
fid,#"to",
nil];
// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or publishing a story.
NSLog(#"Error publishing story.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(#"User canceled story publishing.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:#"post_id"]) {
// User clicked the Cancel button
NSLog(#"User canceled story publishing.");
} else {
// User clicked the Share button
// Show the result in an alert
[[[UIAlertView alloc] initWithTitle:#"Result"
message:#"Message Posted Successfully"
delegate:self
cancelButtonTitle:#"OK!"
otherButtonTitles:nil]
show];
}
}
}
}];
}
- (void)facebookViewControllerDoneWasPressed:(id)sender {
NSMutableString *text = [[NSMutableString alloc] init];
// we pick up the users from the selection, and create a string that we use to update the text view
// at the bottom of the display; note that self.selection is a property inherited from our base class
for (id<FBGraphUser> user in self.friendPickerController.selection) {
if ([text length]) {
[text appendString:#", "];
}
[text appendString:user.name];
NSString *fid=user.id;
NSString *fbUserName=user.name;
NSLog(#"");
NSMutableDictionary* params = [[NSMutableDictionary alloc] initWithObjectsAndKeys:#"Test miLineup!", #"message", #"Iphone Apps", #"name", nil];
NSLog(#"\nparams=%#\n", params);
//Post to friend's wall.
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:#"%#/feed", fid] parameters:params HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{
//Tell the user that it worked.
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Shared"
message:[NSString stringWithFormat:#"Invited %#! error=%#", fbUserName, error]
delegate:nil
cancelButtonTitle:#"OK"
otherButtonTitles:nil];
[alertView show];
}
];
//Close the friend picker.
//[self dismissModalViewControllerAnimated:YES];
}
I am trying to implement the native Share dialog from Facebook in a sample application.
Seem to have some problem in doing so.
Things I have done so far:
Included the latest Facebook SDK
Included the AdSupport, Social, Account, Security and libsqlite3.dylib.
Added the sample code from Facebook.
Added -lsqlite3.0 -ObjC to Other Linker Flags as well
Added the app id to the plist
Added the FBUserSettingsViewResources bundle and FacebookSDKResources.bundle to the project
But I can't seem to share the URL. The share dialog doesn't even appear.
My code looks like this:
Viewcontroller.h
#import <UIKit/UIKit.h>
#interface ViewController : UIViewController
{
IBOutlet UIButton *buttonShare;
}
- (IBAction)shareButtonClicked:(id)sender;
#end
ViewController.m
#import "ViewController.h"
#import <FacebookSDK/FacebookSDK.h>
#interface ViewController ()
#end
#implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)shareButtonClicked:(id)sender
{
FBShareDialogParams *params = [[FBShareDialogParams alloc] init];
params.link = [NSURL URLWithString:#"https://developers.facebook.com/ios"];
params.picture = [NSURL URLWithString:#"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"];
params.name = #"Facebook SDK for iOS";
params.caption = #"Build great apps";
[FBDialogs presentShareDialogWithParams:params clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success!");
}
}];
}
#end
Not able to share the URL. Need some guidance on this.
- (IBAction)shareButtonClicked:(id)sender
{
// if the session is closed, then we open it here, and establish a handler for state changes
[FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES completionHandler:^(FBSession *session,FBSessionState state, NSError *error)
{
if (error)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alertView show];
}
else if(session.isOpen)
{
NSString *str_img = [NSString stringWithFormat:#"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"];
NSDictionary *params = #{
#"name" :[NSString stringWithFormat:#"Facebook SDK for iOS"],
#"caption" : #"Build great Apps",
#"description" :#"Welcome to iOS world",
#"picture" : str_img,
#"link" : #"",
};
// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
//NSLog(#"Error publishing story.");
[self.indicator stopAnimating];
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
//NSLog(#"User canceled story publishing.");
[self.indicator stopAnimating];
} else {
//NSLog(#"Story published.");
[self.indicator stopAnimating];
}
}}];
}
}];
return;
}
Do you have Facebook App installed on your device? The Share dialog only works if you have the Facebook app installed.
From the Share dialog documentation :
Tip 1: What if people don't have the Facebook app installed?
The Share dialog can't be displayed if people don't have the Facebook app installed. Apps can detect this by calling [FBDialogs canPresentShareDialogWithParams:nil]; and may disable or hide a sharing button or fall back to the Feed dialog to share on the web. See the HelloFacebookSample included with the iOS SDK for an example.
From what I saw, iOS 6 will return NO for + canPresentShareDialogWithParams:. It only responds to + canPresentOSIntegratedShareDialogWithSession:. But I could be wrong here.
Anyways, this is how I do it -
1. For sharing links :
if ([FBDialogs canPresentShareDialogWithParams:nil]) {
NSURL* url = [NSURL URLWithString:link.url];
[FBDialogs presentShareDialogWithLink:url
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success");
}
}];
}
2.For OpenGraph calls :
id<FBGraphObject> pictureObject =
[FBGraphObject openGraphObjectForPostWithType:#"your_namespace:picture"
title:image.title
image:image.thumbnailUrl
url:image.url
description:#""];
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:pictureObject forKey:#"picture"];
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:#"your_namespace:action_name"
previewPropertyName:#"picture"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success");
}
}];
Check out other ways to share on iOS here
Hope this helps.
This works for me:
NSString *url = #"myUrl";
FBLinkShareParams* params = [[FBLinkShareParams alloc]init];
params.link = [NSURL URLWithString:url];
if([FBDialogs canPresentShareDialogWithParams:params]){
[FBDialogs presentShareDialogWithLink: [NSURL URLWithString:url]
name: #"Name"
caption: #"Caption"
description: #"Description"
picture: nil
clientState: nil
handler: nil];
}
else{
[...]
}
- (IBAction)btn_facebook:(id)sender {
[self performSelector:#selector(fb_func) withObject:nil afterDelay:0.0];
}
-(void)fb_func
{
// if the session is closed, then we open it here, and establish a handler for state changes
[FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES completionHandler:^(FBSession *session,FBSessionState state, NSError *error)
{
if (error)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alertView show];
}
else if(session.isOpen)
{
NSString *str_link = #"";
NSLog(#"%#",str_link);
NSDictionary *params = #{
#"name" :#"name",
#"caption" : #"Description",
#"description" :#"test",
#"picture" : PostimageToPintresrAndFacebook,
#"link" : #"url",
};
// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
NSLog(#"Error publishing story.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
NSLog(#"User canceled story publishing.");
} else {
NSLog(#"Story published.");
}
}}];
}
}];
return;
}