Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

sending text to own wall FACEBOOK

oztemeloztemel Posts: 64Registered Users
Hi,

I searched lots of thread but I couldn't find solution...

I checked my permissions. no problem.. and also passed developer.facebook stream test.. when I run my code, app ask my account info and ask for permissions.. and thats all. no message etc.. please help me what is wrong??

My code is:

-(IBAction)ShareFacebook:(id)sender{

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@\"FBAccessTokenKey\"]
&& [defaults objectForKey:@\"FBExpirationDateKey\"]) {
facebook.accessToken = [defaults objectForKey:@\"FBAccessTokenKey\"];
facebook.expirationDate = [defaults objectForKey:@\"FBExpirationDateKey\"];
}

if (![facebook isSessionValid]) {


NSArray *permissions = [[NSArray alloc] initWithObjects:
@\"user_likes\",
@\"read_stream\",
@\"publish_stream\",
@\"user_photos\",
@\"user_videos\",
nil];
[facebook authorize:permissions];

[facebook authorize:nil];

NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:7];

[variables setObject:@\"#Your Message\" forKey:@\"message\"];
[variables setObject:@\"#http://Your Youtube Link\" forKey:@\"link\"];
[variables setObject:@\"#This is the bolded copy next to the image\" forKey:@\"name\"];
[variables setObject:@\"#This is the plain text copy next to the image. All work and no play makes Jack a dull boy.\" forKey:@\"description\"];

[variables setObject:@\"#Your story\" forKey:@\"story\"];
[variables setObject:@\"#http://Your Youtube Link\" forKey:@\"source\"];
[variables setObject:@\"#Your caption\" forKey:@\"caption\"];

[facebook requestWithGraphPath:@\"/me/feed\" andParams:variables andHttpMethod:@\"POST\" andDelegate:self];


}

Post edited by oztemel on

Replies

  • davidlxkdavidlxk Posts: 43Registered Users
    you have to do it in an asynchronous manner ~

    so the first thing you have to do is to make the class that you have the ShareFacebook method on follow the FBDialogDelegate,FBRequestDelegate and FBSessionDelegate protocol like this:


    @interface newLayer : CCLayer<FBRequestDelegate,FBDialogDelegate,FBSessionDelegate>


    after which you have to create the delegate method fbDidLogin so that in your ShareFacebook method where you call the
    [facebook authorize:permissions];
    , it will call the fbDidLogin delegate method when the user has successfully logon to Facebook.

    btw ~ you called the authorize method twice when you should just call it once by passing in the permissions.

    so if you want you can leverage on the Facebook SDK and show the post to wall dialog in the fbDidLogin method by using:

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    kFBAppID, @\"app_id\",
    linkUrl, @\"link\",
    picUrl, @\"picture\",
    name, @\"name\",
    desc, @\"caption\",
    caption, @\"description\",
    name, @\"message\",
    nil];
    [facebook dialog:@\"feed\" andParams:params andDelegate:self];

    where params is a NSMutableDictionary where you have parameters for the App ID, link URL, picture URL, name, caption, description and message for the dialog.
    Drop Dem is out now! You should check it out at http://itunes.apple.com/us/app/drop-dem/id490101113



    You should follow Drop Dem on Twitter <a href="http://twit
  • oztemeloztemel Posts: 64Registered Users
    davidlxk;396729 said:
    you have to do it in an asynchronous manner ~

    so the first thing you have to do is to make the class that you have the ShareFacebook method on follow the FBDialogDelegate,FBRequestDelegate and FBSessionDelegate protocol like this:


    @interface newLayer : CCLayer<FBRequestDelegate,FBDialogDelegate,FBSessionDelegate>


    after which you have to create the delegate method fbDidLogin so that in your ShareFacebook method where you call the
    [facebook authorize:permissions];
    , it will call the fbDidLogin delegate method when the user has successfully logon to Facebook.

    btw ~ you called the authorize method twice when you should just call it once by passing in the permissions.

    so if you want you can leverage on the Facebook SDK and show the post to wall dialog in the fbDidLogin method by using:

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    kFBAppID, @\"app_id\",
    linkUrl, @\"link\",
    picUrl, @\"picture\",
    name, @\"name\",
    desc, @\"caption\",
    caption, @\"description\",
    name, @\"message\",
    nil];
    [facebook dialog:@\"feed\" andParams:params andDelegate:self];

    where params is a NSMutableDictionary where you have parameters for the App ID, link URL, picture URL, name, caption, description and message for the dialog.
    but I dont want to see feed dialog page.. just I want to send some text and youtube links...
  • oztemeloztemel Posts: 64Registered Users
    davidlxk;396729 said:
    you have to do it in an asynchronous manner ~

    so the first thing you have to do is to make the class that you have the ShareFacebook method on follow the FBDialogDelegate,FBRequestDelegate and FBSessionDelegate protocol like this:


    @interface newLayer : CCLayer<FBRequestDelegate,FBDialogDelegate,FBSessionDelegate>


    after which you have to create the delegate method fbDidLogin so that in your ShareFacebook method where you call the
    [facebook authorize:permissions];
    , it will call the fbDidLogin delegate method when the user has successfully logon to Facebook.

    btw ~ you called the authorize method twice when you should just call it once by passing in the permissions.

    so if you want you can leverage on the Facebook SDK and show the post to wall dialog in the fbDidLogin method by using:

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    kFBAppID, @\"app_id\",
    linkUrl, @\"link\",
    picUrl, @\"picture\",
    name, @\"name\",
    desc, @\"caption\",
    caption, @\"description\",
    name, @\"message\",
    nil];
    [facebook dialog:@\"feed\" andParams:params andDelegate:self];

    where params is a NSMutableDictionary where you have parameters for the App ID, link URL, picture URL, name, caption, description and message for the dialog.
    my viewdidload :
    facebook = [[Facebook alloc] initWithAppId:@\"XXXXXXXXXXX\" andDelegate:self];

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if ([defaults objectForKey:@\"FBAccessTokenKey\"]
    && [defaults objectForKey:@\"FBExpirationDateKey\"]) {
    facebook.accessToken = [defaults objectForKey:@\"FBAccessTokenKey\"];
    facebook.expirationDate = [defaults objectForKey:@\"FBExpirationDateKey\"];
    }

    if (![facebook isSessionValid]) {

    NSArray *permissions = [[NSArray alloc] initWithObjects:
    @\"user_likes\",
    @\"read_stream\",
    @\"publish_stream\",
    @\"user_photos\",
    @\"offline_access\",
    nil];
    [facebook authorize:permissions];

    }


    and share button is:

    [CODE]NSString *filePath = [[NSBundle mainBundle] pathForResource:@"icon_57" ofType:@"png"];
    NSData *videoData = [NSData dataWithContentsOfFile:filePath];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    videoData, @"G
  • oztemeloztemel Posts: 64Registered Users
    also my dont ask user name password.. just ask the permissions...
    and getting that error:
    how can I validate the session...???
    2011-12-24 20:17:49.793 GokhanYedier[20414:207] The operation couldn’t be completed. (facebookErrDomain error 10000.)
    2011-12-24 20:17:49.793 GokhanYedier[20414:207] Err details: Error Domain=facebookErrDomain Code=10000 \"The operation couldn’t be completed. (facebookErrDomain error 10000.)\" UserInfo=0x8451b30 {error=<CFBasicHash 0x8451820 [0x1fddb38]>{type = mutable dict, count = 2,
    entries =>
    2 : <CFString 0x8451300 [0x1fddb38]>{contents = \"type\"} = <CFString 0x8451a10 [0x1fddb38]>{contents = \"OAuthException\"}
    3 : <CFString 0x84519b0 [0x1fddb38]>{contents = \"message\"} = <CFString 0x8451910 [0x1fddb38]>{contents = \"An active access token must be used to query information about the current user.\"}
    }
    }
    2011-12-24 20:17:49.794 GokhanYedier[20414:207] FB SESSION INVALIDATED!!!
  • johnleo142johnleo142 Posts: 1New Users
    Well, congratulations if you fixed that. Have a nice day!
Sign In or Register to comment.