Facebook App request in iOS (not using Dialog) - objective-c

I need to send a request throw my app to user's friends in Facebook (After the app on Facebook is authorized) I know there is a way to do it through the SDK :
[self.facebook dialog:#"apprequests" andParams:params andDelegate:nil];
But I don't need that way to show the dialog I just need to be able to send the request in the background when the user select the friend from (Table View for example).
Is this possible?

The Facebook Dialog API has not been updated (yet, hopefully). You can't bypass the dialog the way you want to do it.
But, you can :
preselect the friends with your own GUI and gives the apprequest the selected facebook ids. This way, the dialog is just to confirm the request.
activate the frictionless parameter, to avoid the dialog the next time you send the request for the same selected friends (the confirm dialog seems to show anyway, though, and immediately disappear, it gives a not-so-nice blink on the screen).
here's the related documentation, in case you need it : https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/

Related

xcode twitter api authorize screen issue

I have an app that I'm using the xcode IDE and writing in Objective-C that uses the twitter api and the 'default' twitter login page for username and password.
I already have all the oauth stuff set up and it is working fine.
I create a new view controller with a web view inside it, and pass the URL of https://api.twitter.com/oauth/authorize.
If I put in my email and password, everything works fine - the view disappears, and we are then off and running.
If I press cancel on the twitter login screen, I get a twitter page saying I need to log in. I need to capture the cancel in my code so I can dismiss the view controller, but I cannot find out what the name of the callback is? I tried didFailLoadWithError but that is not it.
Can someone shed some light on this please?
It turns out it can be handled from the same callback that handles a 'correct' login. except looking for a failure.
So, they have handled it correctly within the original callback.

Post on Twitter in single click - like Instagram

I'm trying to implement Twitter share the way it is done in Instagram.
What it means is that I want the user to approve the built in Twitter credentials (defined in the iPhone settings) and after that, every time the user clicks a "share" button - it will post a tweet on Twitter without the need for the user to fill the text or see additional dialog like the TWTweetComposeViewController.
Any suggestions?
You can achieve this using TWRequest, go through the Q&A in this post..
Use TWrequest to send an image with a text to Twitter in IOS5
But in iOS 6 this might be deprecated, so check out the adjacent classes used for this purpose.

Facebook library login dialog how to modify its appearance?

Using the facebook library in order to login I call this method:
+ (BOOL)openActiveSessionWithReadPermissions:(NSArray*)readPermissions
allowLoginUI:(BOOL)allowLoginUI
completionHandler:(FBSessionStateHandler)handler;
If the allowLoginUI:(BOOL)allowLoginUI parameter is set to yes the facebook login dialog is shown in full screen. Is there any way to change that and have the login dialog appear not in full screen? I would like it to just appear on foreground and take most of the screen size but not full screen.
I've seen this done but I would like to know if it is possible with the current facebook library?
I do not believe you are allowed to modify the login UI. I have seen devs getting rejected for modifying other aspects of the facebook SDK UI bundle (namely the login button) but this was clearly not acceptable.
My best guess is to set allowUI to no, and sort of mimic your own interface.
Although, from a UX perspective, I would prefer you kept it in the style defined by the FB SDK.

Facebook invitation request is not delivered

I am showing a dialog in an iOS app to allow users to select some friends to whom send an invitation to the app.
The dialog is displayed, you can select some friends and press send.
Dialog delegate method callback is called successfuly.
So far so good, but the friend is not receiving any invitation,
is that because the app is still in development?
This is the code I am using to show the dialog, is there any missing parameter?
(access token is fine because the app works).
// Show the UI Dialog
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
kFacebookAppID,#"access_token", #"Invitation message", #"message",nil];
[facebook dialog:#"apprequests"andParams:params andDelegate:self];
Requests are only delivered if the user can reasonably be expected to accept them; if your app is only an iOS app (i.e no canvas implementation / apps.facebook.com URL) then they'll only be displayed in the Facebook app for iOS.
If this isn't happening it may be because your SSO settings for the app aren't correct, so Facebook's app doesn't know how to bring users to your app when they accept the request, check those first - making sure the URL handler is set up correctly in your app, etc.
It may also be because the app is in sandbox mode, but i'm not sure about that one.

Getting results of location permission dialog

I am doing this tutorial that would return the GPS coordinates. When I run the application on the iPhone, I am first presented with the UIAlertView asking permission to access my GPS coordinates.
I need to know from where this UIAlertView is thrown? Is it from the OS?
Can we capture this method? When the user clicks on "Allow" or "Don't allow", can I print his choice to the console?
How can I do this programatically? Is there an event for this?
This alert is shown by the OS. The usage of location-based API must be permitted by the user. You can ask the CLLocationManager for the current authorizationStatus and be notified when the status changes (delegate method will be called). Note that the user also can disable location services later in the settings app.
I assume you are using CLLocationManager. Your delegate will get locationManager:didChangeAuthorizationStatus when the applications ability to use the API changes.
Edit:
The first time your application attempts to use the service, the user will be prompted. If the user answers No, your application will not be able to use the service unless they go to Settings->General->Location Services and change the setting for your application.
If you query the API for status and are disallowed, you could put up your own pop-up and instruct the user on how to change the setting for your application.