How to properly use Bolts Framework code along with Parse and Facebook?

So,

I am building this iOS 8 app where I am using both Facebook and Parse Framework at the same time. I know Bolts is included in the latest Facebook SDK. I am trying to use BFTasks with Parse code to make handling async taks easier, e.g .:

PFQuery *userQuery = [PFUser query];

[[userQuery findObjectsInBackground] continueWithSuccessBlock:^id(BFTask *task){

}];

      

However, including only Facebook and Parse SDK files will prevent me from accessing the above code through Xcode's auto-completion. It even crashes if I try to run something like above.

On the other hand, if I try to include the Bolts Framework project in the project and import the headers #import <Bolts/Bolts.h>

, it will allow me to access the methods using autocomplete, but Xcode will complain, saying that there are duplicate Bolts Framework binaries.

Can someone explain how to do this or send me a link to a tutorial or something else? I might be missing something simple.

Thank you very much in advance

+3


source to share


2 answers


I was able to get it using cocoapods. So I installed the bolts using cocoapods and then manually added the Parse and SDK for Facebook.



I couldn't figure out how to do it otherwise

+1


source


I was having an issue with linker errors after upgrading to Parse SDK 1.9 - the links included BFTask and a few links. Also use FB SDK 3.24 and one version using 4.7. Same problem. No coco capods. I finally resolved it by importing both the FB SDK and Bolts from the default FB location - without providing the copy files and importing the JUST Parse and ParseFacebookUtils frameworks (not their Bolts framework) with the file copies to destination = YES. So - it appears - Xcode needs to access the bolts from the FB SDK location when needed, but DO NOT see the Parse Bolts Framework because Parse was copied to the app folder, but Parse Bolts was not. Therefore there is no double reference to bolts. See if this helps.



0


source







All Articles