I am using FBRequestConnetion to post[only text] on the wall. But, the problem there is deprecated class in latest FacebookSDK , which is FBDialog.
So, Is there any other UIComponent in latest FacebookSDK, through which I can achieve the FBDialog Behaviour to post on the wall.
Or I have to design my own UI and use FBRequestConnection.
I'm confused about this too. Looking at the HelloFacebookSample sample from the SDK, that's what I understand:
In the previous SDK, we could display a dialog where the user can customise the message, and choose to post or cancel. I think this didn't require any special Facebook permissions.
Now iOS6 has a nice native dialog, but the iOS5 fallback is to post directly using FBRequestConnection - which just posts directly without any dialog, and also requires the "publish_action" permission.
I guess I arrived at the same conclusion, if we want a nice dialog on iOS5, we have to:
create the UI ourselves (maybe imitating the IOS6 popup) and ask for the new permission
or use the deprecated headers in the SDK folder (not sure I'd go there...)
Take a look at SDK that was just released + this link for a a native UI built on top of iOS6:
https://developers.facebook.com/docs/howtos/ios-6/
You can also look at the updated sample HelloFacebookSample that's included in the SDK that shows how you can post a status update for a user.
Related
I would like to post on friend wall using the native post dialog and the latest 3.5 iOS SDK. It seems like Facebook simply didn't supply any method to handle this thing.
I am looking at this method (all the supplied methods with this signature:
[FBDialogs presentOSIntegratedShareDialogModallyFrom...]
and see no way of posting on friend's wall.
Does anyone have some insight on this?
You can't post to a friends wall using the iOS share sheet, which is what presentOSIntegratedShareDialogModallyFrom... is a wrapper around.
I'd like to know if there is a proper way to post a message to a user's wall with the new SDK.
From what I understand there is no way anymore to display a message preview with a dialog view to the user before posting.
I'd rather not using deprecated API. I followed the tutorial for login in with Facebook with the new SDK (importing the Framework etc). When it comes to post a message they ask to import the deprecated Facebook.h header (and its friends...) but it generates lot of compilation errors because some classes are named the same.
Do you people use the deprecated API?
Or do I have to create a custom view myself to display a preview to the user and then use the FBRequest method + requestWithGraphPath:parameters:HTTPMethod: to perform the post "in the background"?
The solution is simple. This worked for me:
We need not import the deprecated headers at all. By using only the latest facebook ios sdk 3.0 following is what you can do.
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:#"%#/feed",fbid]
parameters:params
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result,NSError *error)
{
NSLog(#"error %# \n\n\nresult = %#",error,result);
}
fbid is the profile id of the user. You can give the friend's profile id in order to post on his wall.
In case you have to post on the user's own wall, you can either give the graph path as #"me/feed" or as stated above (by giving the fbid as the user's profile id)
Hope this helps.
As of Facebook SDK 3.2, it is now possible to display a native dialog with the new classes available in the SDK. Have a look to FBNativeDialogs, FBShareDialogParams and FBOpenGraphActionShareDialogParams.
I ran into the same problem and I couldn't find a way around importing the deprecated headers, like the tutorial says. After importing both the framework and Facebook.h with friends, clean your project to make sure the linker doesn't complain about the same file names.
The apprequests tutorial still explicitly says to import deprecated headers. So I don't think FB wants you to implement your own views. I would assume they had to release 3.0 and posting to wall and apprequests weren't finished, so they now have this hybrid 3.0/deprecated system until they finish the rest.
I would like to know whether it is possible to add a Facebook Like button to a native iPhone app. In the app, the user browses a business directory or deals. When they tap on an item to view the details, it would be nice to have a Facebook Like button that can be used to post the item to the user's Facebook page.
Facebook writes: "Currently, the Like button is only available in mobile web apps".
My app is a native app and not a web app, so therefore I assume it's not possible. However, I do assume that it is possible to mix native UI components on a screen along with web components and therefore it might be possible to implement the Like button, although I am not sure how you pass data from the native portion to the web portion.
If the only solution is a hack, then I won't implement it because at some point the hack will fail when Facebook alters their API.
read around SO a little, you get many leads. Here's one:
Like button in iOS application
And a comment points to github.com/brow/FacebookLikeView
It has same caveats, but it seems there aren't any magic solutions.
There are these blogposts as well:
http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html
http://petersteinberger.com/2010/06/add-facebook-like-button-with-facebook-connect-iphone-sdk/
But not sure you get a native UIButton. Maybe you can open a webview in the background and emulate a click on it...
GL, update if you have some findings,
Oded.
Now you can use the FBlike button using the following code but it need to download latest sdk and it is the beta version :(
Here is the code:
[FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
[FBSettings enablePlatformCompatibility:NO];
FBLikeControl *like = [[FBLikeControl alloc] init];
like.objectID = #"http://shareitexampleapp.parseapp.com/photo1/";
like.likeControlHorizontalAlignment=FBLikeControlHorizontalAlignmentRight;
like.likeControlStyle=FBLikeControlStyleBoxCount;
[self.view addSubview like];
It looks like Facebook finally decided to allow this, more directly, via the Open Graph API.
See documentation here
Check this out, FB just made it possible through their SDK. Only for testing and ios for now
https://developers.facebook.com/docs/ios/like-button/
First ever SO question, woohoo.
I've integrated the AddThis SDK into an iOS app. I've set it up to share the App Store link to the App via various channels. All works well except the default text in the Twitter message appends "via #AddThis" to the end of the tweet. Although this text is editable by the user, I'd like to change it to "via #MyTwitterHandle".
AddThis' documentation says you can use:
[AddThisSDK setTwitterViaText:#"MyTwitterHandle"];
Except this doesn't work. It raises a warning that AddThisSDK may not respond to the method call and the app crashes when it reaches this line.
Examining the AddThisSDK header file, there's no such method outlined. I've searched their forums and FAQ etc to no avail. And I did run into other instances where the method names in their documentation were different from those in the SDK. If that's the case here I haven't found the correct name. Does anyone know how to do this?
Thanks in advance.
Do you have the latest version of the addthis iOS sdk? http://www.addthis.com/help/ios-quickstart
Please set setTwitterViaText before the sharing code.
This will work:
[AddThisSDK setTwitterViaText:#"My App"];
[AddThisSDK shareURL:myUrl withService:#"twitter" title:#"myTitle" description:myDescription];
This will not work:
[AddThisSDK shareURL:myUrl withService:#"twitter" title:#"myTitle" description:myDescription];
[AddThisSDK setTwitterViaText:#"My App"];
I start writing a simple app to use FaceBook IOS SDK from GitHub.
I have a few questions about it:
Is there a better documentation about those Delegate .. functions ? I cannot find those except the ones in DemoApp in the package
In the DemoApp, fbDidLogin, fbDidNotLogin and fbDidLogout are never called ... even a dialog is shown and I typed in username and password for logging in
I finished my application with FaceBook SDK.Therefore, I can answer my own questions now.
1) Developer can follow the DemoApp OR can visit http://thinkdiff.net/facebook/how-to-develop-facebook-application-for-iphone/ for more information
2) fbDidLogin, fbDidNotLogin and fbDidLogout would only be called IF inline Dialog box (for FaceBook) is used. Those delegate functions won't be called IF FaecBook app or Safari browser is used instead