iOS Facebook api, apprequests sent but not receiving? - ios

I'm currently working on an iOS app, and I use apprequests to bring up the dialog to send request. I can see everything working fine (I got the dialog complete thing) but user is not getting the request! I'm working with a test FB app (not public), I'm thinking if there's something I'm missing on setting up the FB app? Or is there a specify permission I have to enable?
Here is a little piece of my code:
-(void)appRequestsWithMessage:(NSString )message {
NSMutableDictionary params = [NSMutableDictionary dictionaryWithObjectsAndKeys: message, #"message", nil];
[facebook dialog:#"apprequests"
andParams:params
andDelegate:self];
}

To allow App Requests to be shown in Facebook, you have to enable "App on Facebook" in Apps Settings and supply a "Canvas URL" and a "Secured Canvas URL".

Have you added the receiving user as a tester on your Facebook app admin page? As long as you're in sandbox mode, only users added as testers (or any other position) can see, interact with and receive requests from our app.
Check the settings page for your app.

Related

Facebook authorize dialog has no cancel button?

We are using the legacy headers from the Facebook iOS SDK (3.1.1), as we don't want the user to be able to leave the app. This is a particular issue for us, as we are using GameKit and iOS kills the connection rather quickly after leaving the app (a few seconds is enough)
What I am doing right now, to show the login dialog is:
m_facebook = [[Facebook alloc] initWithAppId:m_fbAppId andDelegate:self];
NSArray * permissions = [NSArray arrayWithObjects:#"publish_stream",nil];
[m_facebook authorize:permissions];
However the dialog doesn't have a cancel button, so the user has no way of leaving it, except with a successful login. Is there a fix?
Best,
Gorm
If you use an older version of the Facebook SDK, the 'X' button will not appear at the top-left of the authorization dialog. Updating to the latest SDK solved the issue for me.

Facebook iOS SDK - Simple status update with Dialog

I'm trying to post a simple status update on the Facebook iOS SDK. At the moment, if I include the link parameter, everything will work:
NSMutableDictionary *params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Name here", #"name",
#"Caption here", #"caption",
#"Status update", #"description",
#"http://www.apple.com.",#"link",
nil];
[facebook dialog:#"feed"
andParams:params
andDelegate:self];
But once I remove link none of the remaining parameters are acknowledged and I'm left with a blank message. I simply want to perform the same sort of post you can achieve with Facebook request whereby providing a string for the message parameter is enough for the status update.
Not sure where I'm going wrong.
Actually posing of status messages with feed dialog isn't an option and it's actually not intended to be user like this.
You can consider one of the options:
Requesting publish_stream permission and than issue POST request to Graph API with message parameter (feed connection of user object), see statuses connection documentation (IMO it seems as an good way to go, if you don't afraid to ask publish_stream permission).
Open Facebook App with publishing view (and text pre-filled?), this is described in answer to "How to programmatically open iOS Facebook app with pre-populated status?"
Note: I'm not completely sure about inability to achieve this with feed dialog, so I may be wrong, anyone who know this isn't the case please correct me.

Dialog 'apprequests' friend invites send OK but never get through. (iOS)

I'm having problems getting friend invites working. They seem to be being sent OK (I don't get any errors from the iOS delegates) but the invites never appear on the receivers FB account. I'm using iOS SDK and logging in with test users. The code I'm using to create the invite dialog is:
NSMutableDictionary* dict = [NSMutableDictionary dictionary];
[dict setValue:#"Accept my invite" forKey:#"message"];
[_facebook dialog:#"apprequests" andParams:dict andDelegate:self];
This brings up the dialog where I can select friends to invite. When I hit Send the dialog vanishes and no errors are returned. Problem is that the invites are never received by the people I send them to.
I have set my canvas url, so according to other posts on SO everything should be working fine... but they are not.
Thanks for any suggestions.
Actually this is explained in Requests documentation:
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.
Same stated about App to User requests as well.
This is probably not only because Canvas URL, but also application type (I guess it shouldn't be native to display request)
In fact requests are sent but users not able to see 'em. You can access requests (via Graph API) for users of your application and display 'em in your app.
Solution: (Sending Invitations, getting ID in response, but no Notification alert or request on facebook.......).
Please first remove all requests from your facebook. Then send invitation.(If getting ID in response), then it will be shown 100%.
This is a problem with facebook, it doesn't shows latest requests on top if max notifications/requests reached.(It hides new notifications/request).

Facebook IOS SDK Frictionless Requests

There appears to be no way of setting frictionless requests as on for facebook ios sdk. For Javascript inplementations this can be done in the fb.init method.
The only other reference to my problem is Facebook Requests Dialog: Frictionless Requests in native iOS app possible? where it states that frictionless just works when not in sandbox mode.
Has anyone else found this to be the case?
This call enables frictionless requests:
[facebook enableFrictionlessRequests];
But it is not enough to prevent all dialogs from appearing briefly. Since the frictionless recipient cache is by default not loaded until the first dialog appears. Once the first dialog appears, the frictionless recipient list will be loaded and subsequent dialogs won't appear. However, you can call
[facebook reloadFrictionlessRecipientCache];
after a successful login to have the frictionless recipient cache ready before the first dialog appears.
Franco
Frictionless requests can be turned on by setting the "frictionless" parameter of the apprequests dialog to "1". For example;
// create a dictionary for our dialog's parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity: 7];
// set the frictionless requests parameter to "1"
[params setObject: #"1" forKey:#"frictionless"];
// ... add other parameters ...
// show the request dialog
[facebook dialog:#"apprequests" andParams:params andDelegate: nil];
I think this also answers Frictionless Requests on iOS - how?
In newer version (2/25/2012 and newer) of the facebook-ios-sdk, there is a new FBFrictionlessRequestSettings which you can enable once, and then all future apprequests will automatically be frictionless. So when your app starts, you should do:
[facebook enableFrictionlessRequests];
I prefer this over manually setting the #"frictionless" key to 1 because when you send an apprequest, you will still briefly see the FBDialog pop up and then disappear. If you do 'enableFrictionlessRequests', Facebook.m will automatically set the 'isViewInvisible' param for you and prevent the FBDialog from flashing.
Now with the Facebook iOS SDK 3.2.1, you can use frictionless requests without using the deprecated headers. Please check out the BooleanOGSample for implementation detials.

Enhanced auth dialog on iOS doesn't complete login flow

I have an iOS app that uses the Facebook SDK for authorization. The existing app does not ask for manage_actions permission. I'm using fairly standard code to start the login flow:
NSArray permissions = [NSArray arrayWithObjects: #"email", #"publish_stream", #"user_education_history", #"rsvp_event",#"user_events,user_interests", nil];
[self.model.facebook authorize:permissions];
When I enable the enhanced auth dialog in the FBDev App and then try to sign into my app, I see a new mobile auth dialog prompting me to Add to Timeline. However, clicking the button on this screen does nothing. It doesn't show an error and doesn't return to my app.
Are there any known issues or workarounds for this flow using the new auth dialog?
(Saw this on an iPad with iOS 4.3)
Thanks,
Edit: One more detail, I saw this using the Facebook app for sign in, I haven't tried it using Safari.
This may have been caused because I didn't have the Bundle ID set through the DevApp.
After setting the iOS Bundle ID in the Settings -> Basic -> Native iOS App section of the DevApp, I have stopped being blocked by the Enhanced Auth Dialog.
In Facebook.m you have this method: - (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth safariAuth:(BOOL)trySafariAuth. You can try setting both tryFBAuth and trySafariAuth to NO at the beginning of the method.

Resources