Facebook Posts Not Posting From App Unless Dialog Box Written In - iphone

I use ShareKit to share stories from my app to Facebook and Twitter. I click everything in the app to share, and it pops up with the dialog box giving me the option to Share or Cancel. If I click Share, it never posts. Not in my timeline or news feed, nor where anyone else can see it. If I type something in the dialog box first, it will share. Is this a bug with ShareKit or with Facebook, and how can I remedy this issue?
SHKItem *item = [SHKItem URL:[NSURL URLWithString:_entry.articleUrl] title:_entry.articleTitle];
[item setCustomValue:#"http://www.316apps.com/icon.png" forKey:#"picture"];
[SHKFacebook shareItem:item];

the problem might be, that you use obsolete original shareKit. Facebook has deprecated "message" parameter in FBDialog, which is used when you share text. A workaround is to use Facebook's Graph api. This is addressed in ShareKit 2. If you decide to try it, make sure to follow install wiki literally, as many things have changed.

Related

Facebook Page link to Photos?

Is there a way to link to the facebook photos tab of a Page via an iFrame loaded from a custom App (tab)? If I try to link to num?sk=photos, it gives me the "Go to Facebook.com" loaded in that iframe. I pretty much want a redirect.
Is that possible? Or does FB block link-ins like that?
Let me know,
Thanks!
I've been using javascript to set window.top.location.href = url;, but after reading Igy's comment, I think I'll be switching to target = _top
I think you should check out facebook developer page.
You can use GRAPH API to access photos, photo albums, profile pictures unless any user has different privacy setting.
You might want to check out GRAPH API for that, I hope it might help you to get started.

iPhone/iOS - How to use "ShareKit" to post only to Facebook or only to Twitter

In my iPhone app, I have two two buttons, labeled "Facebook" and "Twitter".
I want to use the Sharekit framework which makes my sharing very simple. But as shown in the sample code of ShareKit, I can only show many sharing services, which I don't want to include. I want my "Facebook" button to only show the Facebook sharing service, and the same with Twitter. How can I modify ShareKit to work like that?
Update:
Since this answer is still popular, I just wanted to add that with iOS 5 & iOS 6, there is much less need for Sharekit. A lot of popular sharing options are now built into the OS. That being said, this answer is still valid for the sharing services not built into the device, or if your simply more comfortable with Sharekit.
I'll show you how to do it for Facebook, Twitter is exactly the same, just change all the instances of Facebook to Twitter
First, #import "SHKFacebook.h"
then in your button's target method, put the following:
SHKItem *item; //This creates the Sharekit Item
NSURL *url = [NSURL URLWithString:#"http://itunes.apple.com/us/app/...?mt=8"];
The NSURL should be a link to your app on the app store. That way if someone sees a post your app made on Facebook, and they click it, they will be directed to the store so they can download it. Strickly speaking, this is optional, but why wouldn't you try to get new downloads with this extra one line.
Now we need to set up the SHKItem as follows:
item = [SHKItem URL:url title:[NSString stringWithFormat:#"I'm playing someGame on my iPhone! My Highscore is %i, think you can beat it?", highScoreInt]];
Then set up the post like this:
item = [SHKItem URL:url title:#"Share Me!"];
The title parameter is NOT user customizable. Whatever you set here the user will not be able to change. They will have the opportunity to add their own text in addition to whatever you put there.
Finally show the item:
[SHKFacebook shareItem:item];
I hope this helps. As I said, just change the Facebooks in this post to Twitter. Let me know in a comment if you need more help.
Sharekit provides a generic sharing mechanism but also exposes individual services. For instance, if you were to share a URL on twitter, you could write the following code:
#import "ShareKit/Core/SHK.h"
#import "ShareKit/Sharers/Services/Twitter/SHKTwitter.h"
...
SHKItem *item = [SHKItem URL:url title:#"A title"];
[SHKTwitter shareItem:item];
This is all explained in the documentation, but don't fear exploring the header files of the individual services.
I also had the same problem in one of my apps, and tried to force sharekit to do just that.
ShareKit isn't really made for it though, it's meant to be a provide a large range of sharing options - so even after modification, I found that it wasn't a very elegant or efficient solution.
It will save a bit of time, sure - but if you want a good looking, elegant solution I'd suggest integrating twitter and facebook yourself. It takes a bit of time, but you can define the behavior exactly as you want, and theme the interface to suit your app better.

ShareKit programmatically click "publish"

EDIT: It should be noted that I stated in my original question that I was able to get this working for Twitter (I used the referenced question/answer to get that working) . . . I just needed the answer for how to do it with Facebook. I haven't found an equivalent way to do this with Facebook.
I'm using ShareKit to allow my users to share data from my App with Facebook and Twitter.
I'm having a particular issue with Facebook sharing.
My App is almost completely voice controlled, so upon a voice command I call:
// Create the item to share (in this example, a url)
SHKItem *item = [SHKItem URL:#"http://someurl.com" title:#"some title"];
// Share the item
[SHKFacebook shareItem:item];
This works fine, except the user is presented with a dialog (I think a UIWebView) that allows them to edit the post and either cancel or publish.
Since the App is voice controlled, I want to skip this step, basically programmatically click "publish" for them (call the publish method programmatically). I don't mind if that dialog appears briefly and then goes away (this is how I handle Twitter, I was able to figure out how to do this with Twitter). I'm having no luck finding this publish method though - I assume this is because it is a server side call handled by FBConnect.
Any ideas on a) what code to use to do this, and b) where to put that code)?
Many thanks in advance.
Ben

How to post images on facebook wall on a single button click from an iPhone app

I am making an iPhone app where in the user wants that the selected image should be posted on facebook wall on a single button click.
I have Actionsheet button for this.
I want that both authentication of user(loginButtonTapped in tutorial below) and posting images to the wall(rateTapped in tutorial below) be carried out on a single button click.
I am using the example on the link below as my reference for posting images on facebook wall
http://www.raywenderlich.com/1626/how-to-post-to-a-users-wall-upload-photos-and-add-a-like-button-from-your-iphone-app
I am a newbie.
What should I do?
How can I proceed?
Please Help and Suggest.
Thanks.
You can use the facebook Graph Api for posting images to wall..
Here is the tutorial for this...
http://www.capturetheconversation.com/technology/iphone-facebook-oauth-2-0-and-the-graph-api-a-tutorial-part-2
Before sharing you will always have to get the Facebook credentials first by either opening the Facebook App (which is called SSO / Single Sign On) or, in case the Facebook App is not installed, by opening the WebView or Safari. Posting stuff to Facebook can be pretty tricky therefore I wrote a simple lib, called BMSocialShare. It is also supporting "single click sharing". You can do things like uploading photos to Facebook easily:
BMFacebookPost *post = [[BMFacebookPost alloc] initWithImage:[UIImage imageNamed:#"image.png"]];
[[BMSocialShare sharedInstance] facebookPublish:post];
or also create a normal post:
BMFacebookPost *post = [[BMFacebookPost alloc]
initWithTitle:#"Simple sharing via Facebook, Email and Twitter for iOS!"
descriptionText:#"Posting to Facebook, Twitter and Email made dead simple on iOS. Simply include BMSocialShare as a framework and you are ready to go."
andHref:#"https://github.com/blockhaus/BMSocialShare"];
[post setImageUrl:#"http://www.blockhausmedien.at/images/logo-new.gif"
withHref:#"http://www.blockhaus-media.com"];
[[BMSocialShare sharedInstance] facebookPublish:post];
I wanted to add on my personal experience on using BMSocialShare created by vinzenzweber here, and my reputation only allows me to answer. It saved me a lot of time and from the trouble of reading Facebook's documentation, for something as simple as sharing an image for my photo app.
Just a couple of pointers on the documentation of it which might not be immediately obvious for someone using the library for the first time.
When inserting the snippet into your Info.plist containing the Facebook app id, you need to affix 'fb' in front of the number app id.
Besides adding the BMSocialShare.framework into the Xcode Project, you need to manually drag the BMSocialShare.bundle and the FBDialog.bundle in the resources folder of the BMSocialShare.framework, into the Copy Bundle Resources section under Build Phrases of your application's target

"Share to facebook" button issue in displaying thumbnails

I have added a "share to Facebook" button in all my website's articles.
Clicking this button would normally open a new window showing the Facebook post's preview: the post's title, the post's description, and the ability to select one of the page's images, as a thumbnail to my Facebook post.
Without no reason, the past few days, this functionality has problems. There are no thumbnails to select and eventually the post in Facebook looks like
"WEBSITE URL" [post title]
website url... [post description]
Can you please help me find what's the reason for this, because I couldn't manage to solve it myself.
I would suggest running your URL thru Facebook's linter tool https://developers.facebook.com/tools/explorer and fix any issues it has with your og: tag setup. Once that is fixed, then you can troubleshoot why the plugin is not picking up the information correctly.