简体   繁体   中英

Help accessing a fan page with Facebook SDK for iOS

I'm working on an app that uses the Facebook iOS SDK and I need some help. I want to post on a fan page and not on the user's wall.

When we do

[facebook dialog:@"feed" andDelegate:self];

the user posts on his own wall. So I tried this:

[facebook dialog:@"/APPLICATION_ID/feed" andDelegate:self];

with no result. With the older API it was very simple, the following worked:

FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.userMessagePrompt = @"Example prompt";

    dialog.targetId = @" APPLICATION_ID ";

Unfortunately, this property was removed in the current SDK.

The official documentation explains that we have to change the access_token but don't specify if we must take it for the user or the application, and doesn't explain how to do that.

I tried

[facebook requestWithGraphPath:@"/me/accounts" andDelegate:self];

but the result is an object containing empty data...

Is there something wrong with my code, and is there documentation that I'm unaware of for the iOS SDK?

You can use the dialog in the SDK, and specify the "to" parameter.

See http://fianbakken.com/wordpress/?p=272

for example on how to post to a fan page a user likes (same as a application page a user likes).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM