I have a iOS mobile application that needs to send out an app request to a user's friends. From here:https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk and here:https://developers.facebook.com/docs/reference/dialogs/requests/#mfs it appears I am able to suggest the users that this app requesst gets sent to. I am making the call like this:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Check out this awesome app", #"message",
#"1xxx4,10xxxx0,", #"suggestions",
nil];
[self.facebook dialog:#"apprequests"
andParams:params
andDelegate:nil];
However, once the multi-friend request dialog is presented, I am still able to type in a friends name, even if it was not part of the "suggestions". How do I make this restriction?
The end goal is to restrict that list to facebook friends who are not users of this app. The docs also mention a "filters" parameter, but i have not got that to work.
Ideas?
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.
I am trying to use the facebook dialog to send request to my friend using the following:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Come check out my app.", #"message",
nil];
[facebook dialog:#"apprequests"
andParams:params
andDelegate:self];
the delegate - (void)dialogDidComplete:(FBDialog *)dialog { was triggered but apparently I dont see anything on my friends account. I've added him as a tester of the app through the developer account. Why is this?
From https://developers.facebook.com/docs/requests/:
User to User Requests are only available for Canvas apps, not
websites, as accepting a request will direct the user to the Canvas
Page URL of the app that sent the Request.
Do you have a canvas url specified in your app settings?
Also what does the response look like from Facebook at the completion of the dialog? It should look like:
{
request: 'REQUEST_OBJECT_ID'
to:[array of USER_IDs]
}
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/
I'm trying to let users create an event on my public Facebook page via an iPhone app, and hopefully let ppl invite their friends to that event.
The idea is that the iPhone app will be able to show the users events from that page, while everyone is able to add the events.
After Authorizing with permissions: create_event and manage_pages, i'm trying to run the following code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"My Event",#"name",
PAGE_ID, #"page_id",
#"2011-11-10T13:30",#"start_time",
#"2011-11-11T13:30",#"end_time", nil];
[facebook requestWithGraphPath:[NSString stringWithFormat: #"%#/events", PAGE_ID]
andParams:params
andHttpMethod:#"POST"
andDelegate:self];
And I get and error saying: "(#200) Permissions error".
Is it even possible? (creating an event on a page which a user doesn't own)
and if so, what am I missing?
permissions = [[NSArray alloc] initWithObjects:#"offline_access", #"user_events",#"create_event",#"rsvp_event", nil];
I hope that it is just your help.
I am trying to get my iPhone application to post a message to a user's facebook wall.
I have created a facebook app and specified the value of the kAppId in my iphone application.
When i test the iphone app in the simulator, i am prompted to authorize the facebook application, which i accept. however, i then immediately get the message "safari cannot open the page because the address is invalid".
I am trying to troubleshoot this error but am not really getting anywhere. Could it be because my facebook app currently shows: "Directory Status: Not Submitted" ? (I am not able to submit it to the facebook App Directory until i have 5 - 10 users.)
FYI - I have added a "publish to facebook" button in one of my view controllers that responds with the following method:
-(IBAction) publishToFacebook {
facebook = [[Facebook alloc] initWithAppId:kAppId];
[facebook authorize:nil delegate:self];
NSMutableDictionary* params =
[NSMutableDictionary dictionaryWithObjectsAndKeys: kAppId, #"app_id", #"http://www.something.com/", #"link", #"http://www.something.com/something.jpg", #"picture", #"My App Name", #"name", #"The Caption...", #"caption", #"The description...", #"description", #"the message...", #"message", nil];
[facebook dialog:#"feed" andParams:params andDelegate:self];
}
Thanks. Looks like i got this figured out. basically, just follow the instructions on developers.facebook.com/docs/guides/mobile/#ios) and be sure to prefix your app id with "fb" in the plist file (ex. fb123456789 where the facebook app id is 123456789)
Also, to answer my question, your facebook app does NOT need to be submitted to the directory for it to work with iPhone integration.
Did you update your info.plist file with your appid so it knows you to jump back to your app properly?