Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-05-2010, 02:21 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 94
JamesCahall is on a distinguished road
Default Facebook Connect Extended Session Publish Issues

Hi,

I have implemented a Facebook Connect feature in my app to publish information to a users wall. This seems to work wonderfully when the app is first launched and the user logs in. However, if the app is left open for a long period of time after the login, the publish page starts to have issues. Instead of the "Publish to your Wall and your friends' home pages?" dialog box coming up like it does when the user first logged in, the window simply opens and quickly closes. If I quit the app and run it again, the user is then asked to log in again and the publish page works.

So, it seems to have to do with some kind of extended login time that I am not handling correctly.

Here is the snippets of the code that I have included (all not relevant code and facebook key is stripped out). Note that I do not have any dealloc statements related to facebook connect (maybe this is the issue):

Code:
.h file

#import <UIKit/UIKit.h>
#import "FacebookAgent.h"

@interface MoreTableController : UITableViewController 
<UITableViewDelegate, UITableViewDataSource, FacebookAgentDelegate> {


	FacebookAgent* fbAgent;

}

@end

.m file


#import "MoreTableController.h"


@implementation MoreTableController


- (void)viewDidLoad {


	fbAgent = [[FacebookAgent alloc] initWithApiKey:@"removed" 
										  ApiSecret:@"removed" 
										   ApiProxy:nil];
	fbAgent.delegate = self;
}

- (void)updateStatus{
	
	appDelegate = (ArtistAppDelegate *)[[UIApplication sharedApplication] delegate];
	
	fbAgent.shouldResumeSession =YES;
	[fbAgent publishFeedWithName:[appDelegate.data objectAtIndex:39] 
					 captionText:[appDelegate.data objectAtIndex:41]
						imageurl:[appDelegate.data objectAtIndex:43] 
						 linkurl:[appDelegate.data objectAtIndex:15]
			   userMessagePrompt:@"Leave a comment:" 
					 actionLabel:[appDelegate.data objectAtIndex:45]
					  actionText:[appDelegate.data objectAtIndex:47] 
					  actionLink:[appDelegate.data objectAtIndex:49]];
}

- (void) facebookAgent:(FacebookAgent*)agent requestFaild:(NSString*) message{
	fbAgent.shouldResumeSession =NO;
	[fbAgent setStatus:@"Status From Anywhere Artist"];
}

- (void) facebookAgent:(FacebookAgent*)agent statusChanged:(BOOL) success{
}

- (void) facebookAgent:(FacebookAgent*)agent loginStatus:(BOOL) loggedIn{
}

@end
Also, I have added the FacebookAgent and FBConnect folder structure from the standard facebook connect package. Please note that the rest of the app continues to function perfectly and doesn't "crash" to any error codes. I don't know if it helps, but occasionally, it takes a long time for the publish page to load all of its data (this may simply be a facebook server thing and a completely separate issue).

Thanks for your help.

James

Last edited by JamesCahall; 10-05-2010 at 02:24 PM.
JamesCahall is offline   Reply With Quote
Old 10-06-2010, 02:33 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 94
JamesCahall is on a distinguished road
Default

Just to note. This may be related to a multitasking issue. Not sure. Everything else seems to be working just fine.
JamesCahall is offline   Reply With Quote
Old 10-07-2010, 06:57 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 94
JamesCahall is on a distinguished road
Default

Any ideas at all?
JamesCahall is offline   Reply With Quote
Old 10-07-2010, 07:18 PM   #4 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

I dont think that this will solve the issue but overwrite this :
Code:
- (void) facebookAgent:(FacebookAgent*)agent requestFaild:(NSString*) message{
	fbAgent.shouldResumeSession =NO;
	[fbAgent setStatus:@"Status From Anywhere Artist"];
}

to this

- (void) facebookAgent:(FacebookAgent*)agent requestFailed:(NSString*) message{
	fbAgent.shouldResumeSession =NO;
	[fbAgent setStatus:@"Status From Anywhere Artist"];
}
Quote:
Originally Posted by JamesCahall View Post
Any ideas at all?
iSDK is offline   Reply With Quote
Old 10-10-2010, 03:55 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 94
JamesCahall is on a distinguished road
Default

Thanks for the reply but that is just how the coder spelled the function.

Last edited by JamesCahall; 10-10-2010 at 11:54 AM.
JamesCahall is offline   Reply With Quote
Reply

Bookmarks

Tags
crash, facebook connect, publish

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 348
7 members and 341 guests
headkaze, mistergreen2011, nobstudio, Objective Zero, rayjeong, revg, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:11 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0