Customize the sharekit for iphone - iphone

I want to customize the Facebook share button functionality and want to push a new viewController as soon as user share or post on the wall using iphone. I know it is possible, we need to write just 2 or 3 line of code of javaScript but not getting the code. I am using Sharekit in my app. anyone know how to do this?
Thanks

You can detect the post send or shared on user's wall by FBDialogDelegate methods. In your project Expand Sharekit > Sharers > Services > Facebook > SHKFacebook.m and find the method
- (void)dialogDidSucceed:(FBDialog*)dialog
This method will call when user post or share on wall.

You can listen to notifications, which are issued by default during ShareKit workflow. The benefit is, that you do not need to change ShareKit's code.
For preview of notifications sent by ShareKit, look at SHKSharer.m, delegate notification section.
The notifications to listen to are for example
#"SHKSendDidStartNotification"
or
#"SHKSendDidFinish"
etc.

Related

Is it possible to deep link to a Facebook Event page?

I've tried fb://event/EventID#Here which attempts to open the event page in the Facebook app, but then says "Unable to load event. It may have been cancelled." Obviously I didn't cancel the event, and it isn't Private or Guest View only. Is this function simply not supported in iOS 10?
If not, what Facebook deep links are supported? I've only had success with Profiles and Pages, but this post has quite a large list that supposedly work: What are all the custom URL schemes supported by the Facebook iPhone app? (hasn't been updated for iOS 10 though)
fb://event?id=[eventID] appears to work
deeplinks are supported now, your link should be https://facebook.com/events/:eventId/
For me, #Wes answer did not work. Only seems to run with fb://event/:eventId
Maybe the API changed...

Quiz result posting without permission?

I made a app on Facebook which works like a little quiz.
You just have to answer 4 questions and after it you get one of three possible results.
Now I want a button where people can PUBLISH their result, but I don't want to have one of those popups at the start of the application where people have to agree something.
I don't want to automaticly post something on user walls - just if they hit the button they get another Facebook Popup where they can decide if they wanna post the template give on their own wall ...
is it possible ? and if it is ... how ?
Yes, you can do this with the Feed Dialog. Have a look at the Direct URL Example on https://developers.facebook.com/docs/reference/dialogs/feed/ and attach the link to a button in your app.

fbdialog unable to close

I am using the iOS static library project provided by Facebook developers for showing the screen, since there is a session timeout scenario, i have to close the screens when it is 15 mins. when user tries to share the post and if he just leaves it for 15 mins i am not able to close his view instead it just comes like a background after my piece of code which closes all the view (except the fbdialog). the problem is that i don't create fbdialog myself, instead i try that
facebook = [[Facebook alloc] initWithAppId:facebookAppId andDelegate:self] ;
the Facebook class creates the dialog and manages by itself, what has to be done to close the dialog whenever i want from my app to the static library.
In your facebook sdk there must be the methods to close the dialog.
You have to use the delegates it provides in order to send messages to that methods.
Find and implement them in your working class.
It must be something like FBDelegate or FBDialogDelegate, I am not sure, you could share a link to your facebook sdk to see it.
I have worked with several FB sdks and they all ware different.

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