简体   繁体   中英

Facebook iOS Integration

I have recently implemented the Facebook functionality to post an URL as explained in iOS Facebook Development

It's the same as explained.

After I've signed up on Facebook and set my app key, I started the iPhone simulator and authorized as explained on Facebook. After that the Mobile Safari didn't jump back to my app (Because I don't want Facebook to jump back. Later I want to do that calling a webpage by my own). So I just started it again (activated because of iOS 4.2).

After that, I switched to the where I post a default URL.

NSMutableDictionary *params = [NSMutableDictionary dictionary];

NSString *communityURL = @"http%3A%2F%2Fwww.google.com";

[params setObject:communityURL forKey:@"link"];

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

Normally it should bring up a dialog with this parameters, but it just showed an error:

This page contains the following errors:

error on line 25 at column 35: xmlParseEntityRef: no name

Below is a rendering of the page up to the first error.

When I debug into the method which calls the dialog, I got the URL, which will be called. When executing this URL in a web browser, it works.

Why doesn't it work? What's wrong?

i didn't figure out what it was, but i came up with an other solution. I now use ShareKit . It's easy to use and it handles all alone. I try to post some sourcecode snipets asap.

For those, who have the same problem and don't want to use another API, try to do what ever the facebook documentation tells you.

Br Nic

ok what I did is simply add

NSURL *url = [NSURL URLWithString: @"http://www.google.com"];
SHKItem *item = [SHKItem URL:url title:@"Share Item with Google url ;)"];

// Get the ShareKit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

// Display the action sheet

[actionSheet showFromTabBar:self.tabBarController.tabBar];

And that's what I do.

If someone needs help, please feel free!!

Br Nic

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