How to use FacebookSDK 3.1 for iOS5 - facebook

I'm having an issue with using facebookSDK 3.1 on both iOS6 and iOS5.
I got everything running correctly on iOS6 using the tutorials and resources from developers.facebook.com.
Now for iOS5 I'm using the [FBSession openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:] and I see a web authentication pop up in iOS simulator.
However on the callback, I always get back FBSessionStateClosedLoginFailed.
not sure what I need to do to get this working.
Thanks in advance

Related

AdSupport framework not added in ios5 with xcode 4.2

Im integrating FacebookSDK in my app with ios6 and Xcode4.5 .But when I run the app in prevoius versions of XCode (Xcode 4.2 with ios5) I couldn't be able to link Social.Framework and AdSupport.Framework .They are missing and I couldn't find it under Build Phases.Gone through Google and found they are not present in ios5.But when I make those Frameworks as optional .I have made them as optional.But that doesnot work for me .And I couldnot find any turnaround solution to this.
How can I get it worked in xcode4.2
iOS started supporting Facebook API which is Social.Framework is included in iOS 6. It's not available in earlier version for Facebook. You won't get a framework for iOS facebook api in XCode 4.2.
EDIT :
In this case what you have to do is, keep the framework optional which you have already done. Check if Facebook class exists before you call the function. If it does that means user is using iOS 6 or greater version then iOS 6. If it doesn't means user is using iOS version less then iOS 6. To give the reverse compatibility you'll have to implement the Facebook API.

isAvailableForServiceType always returns true?

Simple line of code:
NSLog(#"Checking on Facebook: %d -- Checking on Twitter: %d",[SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook], [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]);
Problem is that I'm getting 1 for both BOOLs. That's a problem because neither Twitter nor Facebook is setup with an account. This is on the simulator, so wondering if people have experienced this is happening on devices as well?
Documentation says that it should only return true if the service is available and at least one account is setup. But I'm getting true even without accounts setup. I'd like to use the values to hide some social posting buttons so would like this to work.
Did you run the that in Simulator?
It seems isAvailableForServiceType always returns 1 in Simulator.
Maybe you can test it in ipad with IOS6.
From my experience, I can confirm this is a bug in iOS Simulator 6.0. The isAvailableForServiceType method always returns TRUE for any service type on iOS Simulator.
On actual device running current iOS 6.0 it is working as expected.
you can test isAvailableForServiceType: using iOS 7.1 on which it is working with simulator as well.
Here What I checked
NSLog(#"Facebook Enabled : %d",[SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook];
Please check this.
I can also confirm that it's broken [i.e., returns True for all three services] in the Simulator (Xcode 4.5.1, iOS 6.0) -- but that it works properly running on a device (iPhone 4S, running iOS 6.0).
isAvailableForServiceType returns true always in both iPhone and iPad simulators.
The same piece of code is working fine in the iOS 6 iPhone and iPad.

iOS 5 Twitter performRequestWithHandler does not work on device

I've converted from using MGTwitterEngine to the new iOS 5.0 twitter API. My app works like a champ when running in the simulator. However, when I run it on the iPad (a device) performRequestWithHandler always ends up with a request timeout. I have allowed my app access to my Twitter account, and the official iPad Twitter client (which is also using the new iOS 5.0 twitter api) works fine.
I am at a loss why it will not work on the device when it works great in the simulator.
My iPad is running software version 5.0.1 (9A405)
Turns out that my issue was related to making the Twitter calls within a NSOperation. I noticed on the device if I brought up other UIViews (or generally manipulated the UI) it would complete the Twitter execution. If I did not touch the UI and wait, it would timeout. So it seems the Twitter operations on a non-main thread behaved differently between the simulator and on an actual device.
Pulling all of my TWRequest calls into the main thread solved the issue.
I did not experience this problem with my prior implementation using MGTwitterEngine.
Is anyone aware of different thread behavior of the iOS 5.0 Twitter framework?

Facebook iPhone SDK, App crashed in pre iOS 4.2, But works fine in iOS 4.2+

I'm working on my iPhone app which needs to share an image link on Facebook. It seems everything is ok and working fine on iOS4.2 or more. But in pre iOS4.2 the app is crashing due to exc_bad_access without any error log. I've tried to trace where this bad access is happening but failed to trace.(I tried nszombieenabled)
Any can suggest me any idea? Thanks in advance.
I faced the same problem. There was no problem in the code. The default Facebook app icon is a *.gif file. Which was causing the crash. I just changed the Icon of the Facebook app from developer.facebook.com and then it worked fine.

Google AdMob Ads SDK only works in simulator

SDK version 5.0.4, device has IOS 4.3.2. When building for the simulator, all is fine and the ads load. When changing to 'device', I get 9000+ warnings(!) "unexpected srelocation type 9" when linking the app itself. When run on a device, the app crashes (EXC_BAD_ACCESS) at the first call in viewDidLoad, [[GADBannerView alloc] initWithFrame].
The problem we had was that originally, we used AdWhirl to serve the old AdMob (nee Google Admob) ads. When using the proper non-test AdWhirl account, AdMob ads (only!) would never show up.
I've tried updating AdWhirl and Google Admob in one go, and removing AdWhirl only using the new AdMob. With the latter the behavior is as described above, when used with AdWhirl it crashes a few seconds later when AdWhirl has loaded the ad.
Surely someone else got this, what did you do to solve it?
(Update: on installing it on another Iphone, I strangely got more info than EXC_BAD_ACCESS. It says:
Program received signal: “EXC_BAD_ACCESS”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Can't find dlopen function, so it is not possible to load shared libraries.)
Cannot access memory at address 0x2fdfe8c0
Cannot access memory at address 0x2fdfe8c0
My guess then is that I must make a shared library static (and that it works on the Simulator, because it has dlopen()). How do I do that?
)
I believe that that with SDK Version 5.0.4, it will only work if you are on the latest version of XCode which is I believe 4.2. Are you on the latest version of XCode?
The problem is in the framework libGoogleAdMobAds.a from GoogleAdMob SDK.
Use previous version of libGoogleAdMobAds.a from adMob.com for your Xcode, not the new one.
After that all 11345 warnings gone and app runs correct on device.
Regards, Papa Buba