Reputation: 624
I've been trying to post a link on user's wall, by using Facebook SDK for the iOS.
I'm trying the code below and it works perfectly when I don't have the Facebook App installed. But when I have it, it just ask me to authenticate and send me back to the App. It happens even just to say that I've already gave the necessary permission, but never shows the dialog to do the share.
The code is:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithFormat:@"%@ %.0f%% OFF", self.offer.description,
[self.offer.price.discountPercent doubleValue] * 100], @"name",
self.offer.store, @"caption",
self.offer.imageKey, @"picture",
@"Test", @"description",
[NSString stringWithFormat:@"http://my_url.com/id%@", self.offer.offerId], @"link",
nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];
Any idea? Thank you in advance ;)
Upvotes: 3
Views: 825
Reputation: 4732
I think this is becouse of you login/logout code. when you making an autorization request to FB, one of params you sending is how long access token must "live". Make shure it lives long anoth. Or, somewhere in the code you invalidating it. May be even losting pointer to access token or something. Make sure, that acces token you use to post is validate at the moment you posting. I suggest you to use official SDK for FB: it's really simple and without any problems. There is great tutorial how to use it: http://developers.facebook.com/docs/mobile/ios/build/
Upvotes: 2