I used fb://publish/?text= to publish from my app in iOS to Facebook but this doesn't work anymore with the Facebook app update to version 5.0 (not iOS6 update). Does anyone know how to publish with new app? Are there another URI schemes that can be used?
I don't want to use any native integration, just a link...
Try this code this will be helpful to you.
NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setObject:str forKey:#"message"];
[facebook requestWithMethodName:#"stream.publish" andParams:params andHttpMethod:#"POST" andDelegate:self];
But for this you must have assigned publish permission.
Related
I'm sending an app request from my iphone app, using this code:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Join my app", #"message", [NSString stringWithFormat:#"%#", [[filteredContacts objectAtIndex:path] valueForKey:#"id"]] ,#"to",
nil];
[facebook dialog:#"apprequests"
andParams:params
andDelegate:self];
while [[filteredContacts objectAtIndex:path] valueForKey:#"id"] returns a facebook ID value.
When a FB friend of mine gets the request he can see it in the notifications section on his facebook - but only on the website itself.
When trying to find it in the facebook iphone app - it's just not there. also, it's not found on the mobile site.
How can it be posible that I see the notification on the website only?
Well the answer was very simple -
I should have define the app as a mobile app when I created it as a FB app.
http://developers.facebook.com/docs/reference/api/post/ doesn't seem to give a clue about it. Would "Install(ed)" be an action? If the feed is something like " installed on iPhone", how to make the to be a link such that the user can tap on it so to lead the user to App Store?
I know the API to use, something like the following. But I just don't know what are the params that should be there for the above feed.
NSMutableDictionary* params = [[NSMutableDictionary alloc] initWithCapacity:1]
[params setObject:username forKey:#"name"];
[params setObject:#"Description" forKey:#"description"];
[facebook requestWithGraphPath:#"me/feed"
andParams:params
andHttpMethod:#"POST"
andDelegate:self];
You can get all info of setting the facebook ios sdk with a screenshot of a post..
http://developers.facebook.com/docs/mobile/ios/build
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 ;)
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/
Is there any way to send friend request through iPhone application? if yes, please help me. I've searched in web but I didn't get solution.
I got the following code to send app request not to send friend request
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:4];
[variables setObject:[NSString stringWithFormat:#"Come and join XYZ App."] forKey:#"message"];
[variables setObject:#"url" forKey:#"picture"];
[variables setObject:#"Hello" forKey:#"name"];
[variables setObject:#"Description" forKey:#"description"];
[_facebook requestWithGraphPath:[NSString stringWithFormat:#"/%#/feed",facebook_user_id]
andParams:variables
andHttpMethod:#"POST"
andDelegate:self];
Please help me.
There is no API to send friend requests, this must be done using one of Facebook's interfaces
The Facebook Graph API doesn't support adding friends. You can get list of friends from the Facebook profile but you can not send the friend request from Facebook Graph API.
I am new to iphone development.I have created facebook application and i have displayed the login page and publish page. now i want to share my content(title and summary) display dynamically.
i dont know how to give the contents dynamically,
Here my code and display statically, it will published.
but i want to give my contents dynamically displayed.
titles and summaries are stored in the mutable arrays.
NSString *art;(titles are stored)
NSString *summ; [Summary are stored];
fbAgent.shouldResumeSession =YES;
[fbAgent publishFeedWithName:#"Sample"
captionText:#"Test Application"
imageurl:#"http://amanpages.com/wordpress/wpcontent/uploads/2009/12/logo2.png"
linkurl:#"http://www.yahoo.com"
userMessagePrompt:#"Share Something about this article"
actionLabel:nil
actionText:#"Search Google"
actionLink:#"http://wwww.google.com"];
This sample code and downloaded in the net. now i want to shared to publish title and summary.
Plz help me out,
Using the fbagent, you cannot publish title+description only, you have to also provide a link to an image and a webpage url.
The image can be your iPhone app icon stored on your site and webpage url can be appstore download link of your iPhone app.
This will help popularize and advertise your app.
So, minimum you can do is:
fbAgent.shouldResumeSession = YES;
[fbAgent publishFeedWithName:art
captionText:summ
imageurl:#"http://amanpages.com/wordpress/wp-content/uploads/2009/12/logo2.png"
linkurl:#"http://amanpages.com/"
userMessagePrompt:#"What do i think:"];
Hope it helps.
just check this example:
NSMutableDictionary* params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
appId, #"api_key",
#"Happy Holi", #"message",
#"http://www.holifestival.org/holi-festival.html", #"link",
#"http://www.onthegotours.com/blog/wp-content/uploads/2010/08/Holi-Festival.png", #"picture",
#"Wanna Kno abt HOLI.. Check this...", #"name",
#"Wish u 'n' Ur Family, a Colourful day...", #"description",
nil];
[facebook requestWithGraphPath:#"me/feed" andParams:params1 andHttpMethod:#"POST" andDelegate:self];
It will publish to your wall. If you want to publish to friends wall,then replace 'me' with [friend facebook UID].
[facebook requestWithGraphPath:#"1908979/feed" andParams:params1 andHttpMethod:#"POST" andDelegate:self];