Hi @arcticfire, mine is working with that very same code, check if you did copy and paste, you must fill your own init method //...al you scene elements.....
Regards.
Jorge.
A fast, easy to use, free, and community supported 2D game engine
Hi @arcticfire, mine is working with that very same code, check if you did copy and paste, you must fill your own init method //...al you scene elements.....
Regards.
Jorge.
@jorgevmendoza i have all my other methods, and stuff.
but it still doesnt work, i have a feeling im using a wrong version of the faebook sdk
Perhaps more of a general Objective C question however it is related, on iPhone the FB popup dialog screen takes up the entire screen so there is no chance of anyone pressing any other MenuItems.
However on the iPad the dialog is a small popup, if I hit 'next scene' for example the FB Dialog will stay on screen and if you press a button it will then crash the app as I assume it is trying to access the delegate that belonged to the scene that was just deallocated?
In the end I went with disabling my layer menu / fading children to grey / pause ccdirector while dialog is in use.
I am launching the login dialog which is followed by a publish dialog, the user can cancel out of either one of these and the delegates are different, so you need to watch both if like me you are using these to restore the layer menu.
// Came out of Login Screen
- (void)fbDidNotLogin:(BOOL)cancelled {
// Came out of Publish Dialog
- (void)dialogDidNotComplete:(FBDialog *)dialog {
// Completed Publish Dialog
- (void)dialogDidComplete:(FBDialog *)dialog
{
Anyway works nicely on iPad now.
Yes, you need to support FBSessionDelegate and FBDialogDelegate
@jorgevmendoza if you are asking about how to implement a delegate, just look at page 1 of this thread as it shows you.
Has anyone been able to integrate the new Facebook SDK with Cocos2d? I'm having trouble figuring out where to put everything so some sample code would be really helpful. Thanks!
i also need to integrate FB with cocos2d v99.5....but i actually can't find the way :((
Hi
I am struggling to integrate Facebook into my project.
I used Jorge's code to help me.
I click on the facebook image and it takes me to safari with a message saying "an error has occurred please try again later".
There was a warning with the code:
[fb authorize:@"your fb api code" permissions:_permissions delegate:self];
warning: 'Facebook' may not respond to '-authorize:permissions:delegate:'
so I altered it to:[fb authorize:_permissions delegate:self];
Is this right?
Also, the permissions code [[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
came up with the following warning: warning: 'FBRequest' may not respond to '+requestWithDelegate:'
so altered it to: [FBRequest getRequestWithParams:params httpMethod:@"facebook.fql.query" delegate:self requestURL:@"facebook.fql.query"];
is that right?
Any advice would be really appreciated as I am stuck.
Thanks
David
Great thread!
However, I continue to get this error:
[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: app_id)
on this piece of code:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"136801456409999", @"f795be5552385eea519fc202d9b99999",
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
obviously it doesn't like the app_ID I've put in there (136801456409999) so I've tried:
fb136801456409999 and used the App Key value instead but still get this error.
I even created 5 different apps and nothing works.
Am I overlooking something here?
Regards,
Joseph
------------------------------
http://www.prestoarts.com
http://itunes.apple.com/us/app/zombie-toss-basketball/id436247664?mt=8&ls=1
http://youtu.be/gFTUBOPXRSY
http://twitter.com/PrestoArts
I think:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"136801456409999", @"f795be5552385eea519fc202d9b99999",
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
Should be something like:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"136801456409999", @"app_id",
@"f795be5552385eea519fc202d9b99999", @"something_else",
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
Nor sure, though. What is clear is that you are not passing a value for the app_id field. This piece of code is probably not the dictionary the app is complaining about because there isnt any app_id key there.
This code came directly from jorgevmendoza's post in this thread:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"your app fb id", @"api_key",
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
I simply substituted in my app fb id and in error my app_key.
I just tried it like this:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
//@"fb136801456409999", @"app_id",
@"f795be5552385eea519fc202d9b99999", @"app_key",
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
And still the same error.
But then I put in a breakpoint and found I crash in Facebook.m line 604:
[params setObject:_appId forKey:@"app_id"];Maybe a little more info as to where I set app_id may help.
In my fbClass.h I do:
Facebook *facebook;
In my fbClass.mm I do:
- (void) facebookLogin
{
if (facebook == nil) {
facebook = [[Facebook alloc] initWithAppId:@"fb136801456409999"];
}
NSArray* permissions = [[NSArray arrayWithObjects:
@"publish_stream", @"offline_access", nil] retain];
[facebook authorize:permissions delegate:self];
}Sorry, I just followed the piece of code you provided.
The crash at:
[params setObject:_appId forKey:@"app_id"];
says it all. Somehow your appId is nil at that point.
I havent seen the code on this thread, its just too long.
Anyway, you got to backtrack the changes (or perhaps the changes that still didnt occur) on _appId to find out why its nil. So sad to state the obvious :-(
i'm using latest facebook connect.. there's no fbsession anymore T^T
[self.facebook dialog:@"oauth" andParams:params andDelegate:self];
the above line runs without error but the dialog didn't show..
`FBLoginDialog* dialog = [[[FBLoginDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.params = params;
dialog.permission = @"publish_stream";
[dialog show];`
the above runs, a dialog shows up but immediately it close...
anyone has any ideas or any lead? thanks!
yeah, theres no more fbsession
what to do
You must log in to post.