FaceBook Connect

Forum for posting sample code and examples, new posts creation is not allowed, but everybody can comment

Re: FaceBook Connect

Postby eras3r » Fri Jan 22, 2010 12:08 pm

@lmarcogimenez
Did you try to pass symbols such as "?" or "=" from JS to Obj-C via JSON?
If the object contains one of those two symbols, the passing fails.

Thanks,

Eras3r
User avatar
eras3r
 
Posts: 68
Joined: Fri Nov 20, 2009 10:53 pm

Re: FaceBook Connect

Postby jacklink01 » Wed Feb 17, 2010 12:04 am

Hey. im sorta confused as to how the Facebook Connect works.

I've got an app where I would like people to be able to login, then a pre-made message can be posted on their wall to promote the app.

If someone could point me in the right direction as to how I need to change this sample to work in that way, that would be great!

Thanks
______________________________
JacKlink Productions
http://www.jacklinkproductions.com
jacklink01
 
Posts: 45
Joined: Mon Feb 15, 2010 11:47 pm

Re: FaceBook Connect

Postby sunny » Wed Feb 17, 2010 1:36 am

write to sunny@nimblekit.com for more sample code
User avatar
sunny
Staff
 
Posts: 1692
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: FaceBook Connect

Postby inveni0 » Fri Mar 12, 2010 6:23 pm

I've got FBConnect working now, and a pretty good idea of how to get it implemented well. My only issue is that I lose the session after quitting the app, even if I select "Keep Me Logged In". Is there a way to prevent it from logging out so that my users don't have to worry about logging in each time they start the app? I know it's possible because I have apps that do it. I just can't seem to find any documentation out there on that specific item.

EDIT: I see that you're supposed to use [session resume] to resume a session. Any ideas on how to implement this?
inveni0
 
Posts: 204
Joined: Thu Jul 30, 2009 3:01 pm

Re: FaceBook Connect

Postby inveni0 » Fri Mar 19, 2010 5:00 am

inveni0 wrote:I've got FBConnect working now, and a pretty good idea of how to get it implemented well. My only issue is that I lose the session after quitting the app, even if I select "Keep Me Logged In". Is there a way to prevent it from logging out so that my users don't have to worry about logging in each time they start the app? I know it's possible because I have apps that do it. I just can't seem to find any documentation out there on that specific item.

EDIT: I see that you're supposed to use [session resume] to resume a session. Any ideas on how to implement this?


Has anyone had any luck in figuring this out? My current issue is that I'm trying to post a story to the user's wall, but because I can't tell if they're logged in, when I call the method to post the story, it won't load if they're not logged in. Is there a way for me to tell?
inveni0
 
Posts: 204
Joined: Thu Jul 30, 2009 3:01 pm

Re: FaceBook Connect

Postby broly » Wed Apr 14, 2010 11:28 am

inveni0 wrote:
inveni0 wrote:I've got FBConnect working now, and a pretty good idea of how to get it implemented well. My only issue is that I lose the session after quitting the app, even if I select "Keep Me Logged In". Is there a way to prevent it from logging out so that my users don't have to worry about logging in each time they start the app? I know it's possible because I have apps that do it. I just can't seem to find any documentation out there on that specific item.

EDIT: I see that you're supposed to use [session resume] to resume a session. Any ideas on how to implement this?


Has anyone had any luck in figuring this out? My current issue is that I'm trying to post a story to the user's wall, but because I can't tell if they're logged in, when I call the method to post the story, it won't load if they're not logged in. Is there a way for me to tell?


I'd love to get sessions to work too.
In addition, the load friends feature does not work at all for me, no matter how much I wait.
Did Facebook change their API and broke this?
broly
 
Posts: 65
Joined: Sun Oct 11, 2009 7:24 pm

Re: FaceBook Connect

Postby broly » Sun Apr 18, 2010 6:20 pm

Just FYI, I have managed to get sessions to work, I'll post here the code changes so everyone can benefit.
In AppFBController.m, change the init function to the following:
Code: Select all
- (void)initSession
{
   _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
   NSInteger* connStatus = [_session resume];
   [self._webView performSelectorOnMainThread:@selector(stringByEvaluatingJavaScriptFromString:) withObject:[NSString stringWithFormat:@"connectionStatus('%d')", connStatus] waitUntilDone:NO];
   self._friendsList = nil;
}


then in your html code you can implement this function:

Code: Select all
var connStatus;

function connectionStatus(status)
{
  connStatus = status;
  if (connStatus == 1)
  {
    loginStatusChanged(1);
  }
 
}

Make sure you call it with the body onload property to setup the initial status display.
The variable connStatus will be 1 whenever a session is successfully resumed.

On a side note, I have worked on this using Sunny's code example, but when I import it in my code I get loads of build errors because the Facebook libraries cannot be found.
Anyone had luck with this?
broly
 
Posts: 65
Joined: Sun Oct 11, 2009 7:24 pm

Re: FaceBook Connect

Postby sunny » Mon Apr 19, 2010 3:29 pm

"Targets->YOU_TARGET->Get Info->Build->Header Search Paths"
Make sure you have FB headers in the place, compare file structure and "Header Search Paths" in sample code and in your example
That should solve your problem
User avatar
sunny
Staff
 
Posts: 1692
Joined: Sat May 30, 2009 5:18 am
Location: kiev, Ukraine

Re: FaceBook Connect

Postby broly » Mon Apr 19, 2010 3:40 pm

Yup, I figured this out last night, it was missing the headers.
All now works perfectly :)
broly
 
Posts: 65
Joined: Sun Oct 11, 2009 7:24 pm

Re: FaceBook Connect

Postby brass » Tue Jun 08, 2010 8:55 pm

jacklink01 wrote:Hey. im sorta confused as to how the Facebook Connect works.

I've got an app where I would like people to be able to login, then a pre-made message can be posted on their wall to promote the app.

If someone could point me in the right direction as to how I need to change this sample to work in that way, that would be great!

Thanks


wondering if you got this to work or can i email you sunny? I don't need everything that FB connect offers, i just want to connect to facebook and have the user share a pre made message that they are using my app, seems to be pretty simple
brass
 
Posts: 56
Joined: Mon Aug 03, 2009 9:00 pm

PreviousNext

Return to Sample Code

Who is online

Users browsing this forum: No registered users and 1 guest