PDA

View Full Version : Question on Facebook Connect for Iphone




oceandrive
Mar 17, 2009, 05:08 PM
Did anyone get a chance to work with the New facebook connect for the iphone ?

The five min video was helpful and I was able to add the facebook connect to my sample app and was able to login.

But the next thing which I was trying to do was to update the status from my sample app. I added the extended permission stuff as shown on the video and a dialog opens up and asks for the permission.

The question now is what do I need to do to update the status message? I see a status.set method on the Facebook api, but did not know how to call the method. Can someone guide me.

i tried to do something with the FQL like "Update status set message = 'something' where uid=xxxxx" which dint work seems like fql is only for select stmts.

Thanks for the help.



oceandrive
Mar 18, 2009, 01:51 PM
figured it out , thanks

fishkorp
Mar 18, 2009, 02:07 PM
Mind sharing in case other people can't figure it out?

oceandrive
Mar 24, 2009, 10:07 AM
[[FBRequest requestWithDelegate:self] call:@"API CALL HERE" params:params];

http://wiki.developers.facebook.com/index.php/Facebook_Connect_for_iPhone


Replace the "API CALL HERE" with what ever function u need.

sapplesystems
Dec 3, 2009, 06:16 AM
Hi

I want to connect facebook API's with my IPhone. For this I have downloaded the FBConnect sdk and included the FBConnect group of FBConnect.xcodeproj in my application and then I have written the following code in FacebookAPPViewController.m

(void)viewDidLoad{

[super viewDidLoad];

session = [FBSession sessionForApplication:@"appId" secret:@"appSecret" delegate:self];

FBLoginButton *button = [[[FBLoginButton alloc] init] autorelease];
[self.view addSubview:button];

FBLoginDialog* dialog = [[[FBLoginDialog alloc] init] autorelease];
[dialog show];
}

but it is showing error that session undeclared. That is right also because I have not initialized it but if I declare it with class FBSession then also It displays some error and if I exclude this line then the button to connect to facebook does not appear.

Can some one help me?

Thanks in advance

Gaurav

robbieduncan
Dec 3, 2009, 06:57 AM
session = [FBSession sessionForApplication:@"a31c3e53bba4a5f2b3955d6e5e 876717" secret:@"6ecbefa3807406bd13187297e58efae9" delegate:self];

Please tell me you are clever enough not to have posted the real values for these here?

sapplesystems
Dec 3, 2009, 07:52 AM
Please tell me you are clever enough not to have posted the real values for these here?

This application is with a dummy link in facebook which will not work after few hours. Could you please help me in solving my issue

robbieduncan
Dec 3, 2009, 08:03 AM
This application is with a dummy link in facebook which will not work after few hours. Could you please help me in solving my issue

OK: you are using a variable session that you have not declared. The compiler error is very clear and simple. You need to declare variables before you use them. Go and learn basic C (from the beginning).

sapplesystems
Dec 3, 2009, 08:15 AM
OK: you are using a variable session that you have not declared. The compiler error is very clear and simple. You need to declare variables before you use them. Go and learn basic C (from the beginning).

I know this dude :)

but by which class should I declare it because when I used

FBSession session = [FBSession sessionForApplication:@"appId" secret:@"appSecret" delegate:self];

then I am getting error : variable-sized object may not be iniatialized.

So , How can I get rid of it?

robbieduncan
Dec 3, 2009, 08:17 AM
1) That's not what's in your original code so how are we supposed to know what you've done? Read your mind. If you want help then at least help us by posting accurate information

2) I've not read the documentation on FBSession but I'll assume it's an Objective-C object. In which case you cannot assign it to a on-stack variable. You will be given a pointer to it so your variable must be a pointer. This is ultra-basic Objective-C.

sapplesystems
Dec 3, 2009, 08:32 AM
Altough I have mentioned it in my original post

but it is showing error that session undeclared. That is right also because I have not initialized it but if I declare it with class FBSession then also It displays some error and if I exclude this line then the button to connect to facebook does not appear.


ok its my bad :o

I will try to be more clear and explanatory in future.

Anyways thanks for your support

dejo
Dec 3, 2009, 10:24 AM
What datatype is FBSession? That will determine how you need to declare it.