Facebook Connect issue with the iPhone - iphone

I have to integrate FaceBook connect with the iPhone App.
I downloaded SDK, added new app on the facebook.
But I have a problem. All samples and tutorials contains feature with feeds publishing.
In the sample which included in the SDK I have to insert Template Bundle Id instead of '9999999':
- (void)publishFeed:(id)target {
FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.templateBundleId = 9999999;
dialog.templateData = #"{\"key1\": \"value1\"}";
[dialog show];
}
Where can I create templateBundleId? I can't found how to create it in the Developer's Tools.
May be templates is deprecated. If it's true then what can I use for publishing on the FB? And how can I do it with the iPhone SDK?

You create the templateBundleId in the console - http://developers.facebook.com/tools.php

Related

Sharekit2.0 could not post together "URL-linked text, image" information to facebook wall

I'm upgrading from old sharekit to latest Sharekit2.0.
Ultimately I need to reach this on Facebookshare: https://s3-ap-southeast-1.amazonaws.com/eight29/demo.png
In old sharekit, I can do that by dialog.attachment (FBStreamDialog) as shown as below. However, in latest version, this function is missing.
BStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.userMessagePrompt = #"Post Item to Facebook";
dialog.attachment = [NSString stringWithFormat:#"{\"name\":\"example\",\"href\":\"http://apps.facebook.com/example/?%d\",\
How can make it?
Thanks!
Liang
FBStreamDialog is not technically a part of ShareKit, but it belongs to Facebook-ios-sdk, which happens to be used in ShareKit.
FBStreamDialog no longer exists in FB's sdk, and other FBDialog family classes are deprecated. I suggest you to use their graph api, check "publishing" section for all possible parameters. Hopefully some will suit your purpose.
As for implementation, check SHKFacebook's - (void)doSend method. You can then subclass SHKFacebook and implement your own.

FBStreamDialog no longer working as expected

I am using an FBStreamDialog to display a custom prompt, capture a text message and then display that message, along with an MP3 file on a chosen Facebook friend's wall. The code has been working fine for the last 6 months in my live app. This week, however, it has stopped working. It can only be the result of a recent change in how Facebook responds to the function calls (I've logged a bug:
https://developers.facebook.com/bugs/344519698917066browse=search_4f611f5d302a37460391579).
Has anyone else encountered this problem and is there an alternative I can use without having to recode the entire FB connection stuff?
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.userMessagePrompt = #"Enter your special message:";
dialog.attachment = [NSString stringWithFormat:#"{ custom string stuff here"}]}", friendName, #" "];
FB support response to this says I should just install a later version of the SDK and that they can find no reference to FBStreamDialog! I think this is poor when app developers have live products.

Error when posting to Facebook Wall from iPhone app

I'm building an app that allowed me to post to a user's wall on facebook. This functionality was working fine up until recently, when for some reason, if I try to post to the wall on facebook, I am now getting the error:
"The post's action links must be valid url's. You can see this because you are one of the developers of the app."
Does anyone know why this is happening? I did not change the code at all in my app, and after searching the web, found others are also having the same problem when trying to post to their facebook wall, but without a solution. Does anyone know what is wrong here, and how to fix it?
How old is the code that you are working with? And, are you using OAth 2.0? If you're not you should, because I believe OAuth 1.0 has been deprecated by Facebook and is only supported for "legacy" applications.
I found the solution to my problem. The relevant code that was causing the problem is:
- (void)postToWall {
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.userMessagePrompt = #"Enter your message:";
dialog.attachment = [NSString stringWithFormat:#"{\"name\":\"Check out this great restaurant!\",\"href\":\"/\",\"caption\":\"%#\",\"description\":\"%# \r %#, %# %#\",\"media\":[{\"type\":\"image\",\"src\":\"http://www.muslimgreenpages.ca/images/gethalal/GetHalal_IC_B_03.png\",\"href\":\"http://www.gethalalapp.com/\"}]}",
restaurantObj.name, restaurantObj.address, restaurantObj.city, restaurantObj.provinceState, restaurantObj.phoneNumber];
dialog.actionLinks = #"[{\"text\":\"Download GetHalal!\",\"href\":\"http://www.gethalalapp.com/\"}]";
[dialog show];
_posting = NO;
[_session logout];
}
In my dialog.attachment, I did not provide a value for the href parameter, so I simply removed it, and everything worked! Thanks very much mdominick for trying to help.
Take care.

How to give extended permissions in FBConnect with REST API in iPhone

I have developed an iPhone application, which is communicating data with faceBook. Initially I was only able to get basic information of user from Facebook. To post to a user's wall, I learnt about giving extended permission 'publish_stream', hence I added following code snippet:
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.permission = #"status_update";
[dialog show];
[self getFacebookName];
}
And made necessary changes in the FBPermissiondialog class file.
Now this is allowing me to post to my wall, but it shows two separate dialogs for permissions, first to access user's basic information, and second for publishing permission. I want to have all permissions in a single pop-up. Also, I am using FBRequest to post to Facebook, not FBStreamDialog (as I dont want the UI for posting).
Please help me with this, I badly need to resolve this issue soon.
Thanks in advance.
In FBLoginDialog.m file
- (void)loadLoginPage {
NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
#"1", #"fbconnect", #"touch", #"connect_display", _session.apiKey, #"api_key",
#"fbconnect://success", #"next",#"user_photos,photo_upload",#"req_perms",nil];
[self loadURL:kLoginURL method:#"GET" get:params post:nil];
}
add "req_perms" key to the dictionary as shown above.
Hope this will solve your problem :)

FBLoginDialog auto ask for Basic Permission before didLogin

I am using the old facebook iphone sdk to develop a iphone app: https://github.com/megastep/facebook-iphone-sdk
I am currently encountering a problem: The FBLoginDialog auto ask for Basic Permission before the didLogin callback.
I want to skip this part as I want to ask Exteneded permission.
And idea why facebook is asking the basic permission before the callback didLogin?
Thanks.
FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:session] autorelease];
// dialog.delegate = self;
[dialog show];
You need to move to the new SDK. The SDK you are using is known to be buggy in several ways, it leaks memory and has problems on the 4.2 OS when the user is editing text and the keyboard is on screen.
Note also that the new SDK makes it extremely easy to ask for whatever permissions you need, you can just do it in the authorize:delegate method (see the sample project included in the sdk for an example).
Edit/Update:
Facebook asks for basic auth before didLogin because the user has to at least authorize your application.