Question

i will like to know how to post to my own wall with a string @"123456789" after logging in to FB with this

facebook = [[Facebook alloc] initWithAppId:kAppId andDelegate:self];

    // Check and retrieve authorization information
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) {
        facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
        facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
    }

    // Initialize user permissions
    userPermissions = [[NSMutableDictionary alloc] initWithCapacity:1];

    if (![facebook isSessionValid]) {
        NSArray *permissions = [[NSArray alloc] initWithObjects:
                                @"publish_stream", 
                                nil];
        [facebook authorize:permissions];
        //[permissions release];
    }
Was it helpful?

Solution

use the following code to feed

  NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   [NSString stringWithFormat:@"YOUR MESSAGE"],
                                   @"message", nil];
    [facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod: @"POST" andDelegate:self];

OTHER TIPS

You can always create your own request and post it to facebook, like the following request: you specify what you want from: type, link, picture, source, message, name, caption, description, and you must provide an access_token, which if you're using facebook api, you can get easily.

https://graph.facebook.com/me/feed?type=&link=&picture=&source=&message=&name=jwt&caption=inmyworld&description=&access_token=

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top