Suppressing Facebook SDK UIAlertView in iOS - ios

I use the Facebook SDK for login in my App, I am on the newest version 3.2.1 and am having an issue with some of the errors the SDK throws. For example (and I know this is an outlier case) if a user logs into my app, then while that session is open removes my app from their facebook, then logs out/logs in on my app Facebook throws a UIAlertView that says com.facebook.sdk error 5, then if the user logs in again it works just fine by re-requesting permissions as it should.
While this is a weird use case, it speaks to the larger issue of not wanting Facebook to communicate with my users through jibberish AlertViews, I would much rather detect the error and throw a proper alert that a user can understand.
Is there anyway (without re-writing the SDK, and yes I have filed a bug) to suppress all UIAlertView's from Facebook SDK, and throw my own?

When following the login procedures described here: you have total control over the alerts. Facebook just passes you the error and you can chose what to display to the user, if anything.
Look at the Scrumptious sample app for an example.
If you have a specific case where the Scrumptious sample app throws an alert that you cannot control, please describe.

Related

Sharing / Twitter not working as usual

When trying to share a picture on Twitter from an iOS app (of mine) -- already on the appStore -- I keep getting this message:
But the reality is that I am already logged in to a Twitter account.
I can switch to the Twitter app, confirm that I am logged in and come back to the current app.
Am I doing something the wrong way with Twitter?
Or is possible that something is not working with the app itself?
I need to say that this kind of sharing used to work without problems.
So this might be due to some recent change in the iOS.

Facebook login error: "The developers of this app have not set up this app properly for Facebook login"

I've been seeing error like this when trying to use Facebook Login.
I've checked everything including setting up the pList
and followed solutions in this link
The developers of this app have not set up this app properly for Facebook Login?
by setting the "
Do you want to make this app and all its live features available to the general public?" to YES
but then this image came up.
When I first try doing facebook login there's no need to even turn the live feature available to YES to make it work I wonder what went wrong.
Ok guys i found the solution, just go to facebook on your safari in the iOS simulator and log out the current user or test user and create a new test user. It should work!

How do I use Facebook Login via Facebook App for iOS

I have a little problem. I am sing Facebook's API to get users information. I am using the code that provide here: https://github.com/pedro1993/ios-howtos
In those examples, when somebody logs in with Facebook they are taken to the Facebook app, whereas when in my app, Facebook is opened in a UIWebView. How can I stop that from happening and use the Facebook app?
Here is an example:
Peter
Follow this official tutorial instead https://developers.facebook.com/docs/facebook-login/ios/v2.0
Update Facebook SDK has several fallback behaviors to try before it falls back to in-app web view. You can debug it by setting breakpoints in corresponding places in code. From the look of it https://github.com/facebook/facebook-ios-sdk/blob/296771f5ed7674fcbed9c31cf39bf9c8e4706403/src/Login/FBSession.m#L1039 seems like a good place to start.
Especially try to debug -[FBSessionAppSwitchingLoginStategy tryPerformAuthorizeWithParams:session:logger:.

Initiate Facebook Group Chat from iOS App

I want my app to create a new Facebook group chat with certain people that opens either on Facebook's site in Safari or in the native Facebook app when the user presses a button. I want Facebook to handle the whole chat and my app only to initiate it somehow in the cleanest and least involved way possible. My app already uses the Facebook SDK to open an active FBSession, so I've already got login credentials.
Looking around online and in Facebook's docs, I can't find anything that suits my needs. The closest thing I found was in this answer containing a list of Facebook app URLs you can connect to that open the Facebook app to certain pages. There's "fb://chat/(initWithUID:)" and "fb://messaging/compose/(initWithUID:)". However, not only is there no explanation on how to use these, but people say that Facebook has changed these URLs (and does not have any documentation on them), so they don't work anymore unless I reverse-engineer new URLs (which could change again). Ugh, so close!
I also found examples on starting chats with the Facebook Chat API, but that involves logging into Facebook using some networking framework then writing my own GUI and model for sending messages, which I am only prepared to do as a last resort. There should be some way to let the Facebook app or website do all that. Does anyone know how I can do this?
I've found something very close, but I still don't see a way to make my app initialize it with the desired group of friends:
The Facebook SDK has a message dialog that can appear for sending messages to friends. This isn't exactly what I wanted but is good enough because it means that all the programming is already done for me by Facebook, and users should be able to see these messages on https://facebook.com and the Facebook apps. https://developers.facebook.com/docs/ios/share#message-dialog

What if Twitter or Facebook accounts are not configured on iOS 6?

Does anybody know a smart way to bring the user to enter their Facebook or Twitter account login information, if they aren't already logged in? For example, a user tries to log in my application with Facebook without configuring the Facebook account in the iOS settings. Can I ask him to do it with an alert, for example, but how can I bring him to the exact section of settings for that?
#rckoenes is correct. Under normal circumstances there is no way to manually send the user to preferences. There was a method of doing this introduced in iOS 5, but Apple quickly depreciated it in iOS 5.0.1 or 5.1 I don't remember exactly which one.
Now, on to the current situation. If you are using an SLComposeViewController in the Social Framework, you don't even have to worry about adding this functionality yourself. It is done automatically by iOS. Below is a screenshot from my 6.0 simulator attempting to post to Facebook without any accounts signed in. This is also true for Twitter and Sina Weibo.
You can't, there is no way to get the user to the settings app lett a lone the correct section.

Resources