OceanLabs / FacebookImagePicker-iOS

A Facebook image picker providing a simple UI for a user to pick photos from a users Facebook account. It provides an image picker interface that matches the iOS SDK's UIImagePickerController.
https://www.kite.ly
MIT License
103 stars 56 forks source link

Picker shows only black background #9

Closed piotrros closed 8 years ago

piotrros commented 8 years ago

Hi, I've added your library via cocoa pods to my swift project like this:

use_frameworks!
pod 'FacebookImagePicker'
post_install do |installer|
  installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
    configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
  end
end

Then I simply import module:

import FacebookImagePicker

and then show the picker:

var picker = OLFacebookImagePickerController()
self.presentViewController(picker, animated: true, completion: nil)

First facebook app (or safari with facebook page if app is not present) starts, asks for permission (I use test accounts), comes back to app and this is what I see:

ios simulator screen shot 31 sie 2015 23 21 37

ofc I have some photos added on this user.

piotrros commented 8 years ago

I figured it out!!!!!

I debugged sample code very deeply and found out that facebook is returning 1 album while in my project it's returning 0 albums. I finally found difference in code from github and one installed from cocoa pods. Look here: https://www.diffchecker.com/vffe3aew

"if" always failed because coverPhoto is not a NSString.

So I reverted this file to the one from github, but actually there's one more thing needed to do: add this to podfile: pod 'Facebook-iOS-SDK', '~> 3.23.2'

probably without specifing version facebook sdk has another version, which somehow doesn't call completionHandler at all.

Damn, that was hard.

kkarayannis commented 8 years ago

This should be solved even without a specific FB SDK version. Closing the issue.