Question on Facebook Connect for Iphone

Discussion in 'iOS Programming' started by oceandrive, Mar 17, 2009.

  1. oceandrive macrumors newbie

    Joined:
    Nov 17, 2008
    #1
    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.
     
  2. oceandrive thread starter macrumors newbie

    Joined:
    Nov 17, 2008
  3. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #3
    Mind sharing in case other people can't figure it out?
     
  4. oceandrive thread starter macrumors newbie

    Joined:
    Nov 17, 2008
    #4
  5. sapplesystems macrumors newbie

    Joined:
    Nov 26, 2009
    #5
    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

    Code:
    (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
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Please tell me you are clever enough not to have posted the real values for these here?
     
  7. sapplesystems macrumors newbie

    Joined:
    Nov 26, 2009
    #7
    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
     
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    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).
     
  9. sapplesystems macrumors newbie

    Joined:
    Nov 26, 2009
    #9
    I know this dude :)

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

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

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

    So , How can I get rid of it?
     
  10. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    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.
     
  11. sapplesystems macrumors newbie

    Joined:
    Nov 26, 2009
    #11
    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 :eek:

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

    Anyways thanks for your support
     
  12. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    What datatype is FBSession? That will determine how you need to declare it.
     

Share This Page