ibm-bluemix-mobile-services/bms-clientsdk-swift-security-facebookauthentication

Unable to import Class

Closed this issue · 9 comments

HI Im unable to import the FacebookAuthenticationManager class.

So to rule out any issue I may have caused I downloaded the sample and run pod install and opened it in Xcode 8 and it got the same error so I removed the project re-downloaded and installed pod's again and opened in Xcode 7.3 current version and the sample projects get's the same error of class not being found.

screen shot 2016-08-01 at 8 23 31 pm

All pods are installed .

Hi,
Did you do this step (from Readme.md):
"After you update your Podfile, the pod's sources are added to your workspace. Copy the FacebookAuthenticationManager.swift file from the BMSFacebookAuthentication pod's source folder to your app folder."?

NO I did not I only quickly scanned the READ.ME as to the method I needed to call. Ok this sort of defeats the purpose of having a Pod is this something that may be changed. I know these are new SDK's So I only hope its temp feature.

Hi,
We might change this in the future

ok IM Looking at a old project I had I think Ive had to do this before and was able to get CocoaPods to do the copy in install. So leave this issue open for a hour or so I can have a chance to pod that here. Ages ago for some reason I needed to have some code or bundle part of the project and not in a framework and I ended up using cocoapods to manage that for me so I could update etc.

I have the project at work so I will post the code when Im in the office , It's added to the pod spec and will copy the file into the target root. I Hope this will help should I post here or issue a pull request ?

Ok , Now when this was setup the one Source file was set in the PodSpec as a resource not source file . I'm guessing that was done as the person was hoping it would be copied as a resource to the target folder.

Now Its added to the build script as a resource but that would only copy the file into the build folder not the project folder. I did something like this before when I had a issue where I needed a file in my project folder from a pod and run in to this same issue.

Now Ive got a script that will work if the pod spec is changed to include the file as a source file so it creates a pod target. Now if that is not possible then a simple bash script should work so Ive not submitted a pull request till I know which option should be used so for example if the file as changed to a target then this post install script will do the trick

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target == "BMSFacebookAuthenticationManager" then

            folder_path = "Pods/#{target.name}/Source/FacebookAuthenticationManager.swift"
            %x~ if [ ! -f #{folder_path} ]; then cp #{folder_path} #{folder_path}.bak; fi ~
        end
    end
end

as you can see Im only coping the file in place but it is easy to change to copy to project folder. Now this currently dose not work as the BMSFacebookAuthenticationManager is not in the targets array as of the reason above. Please let me know if this a option as we can update the PodSpec and put this post install script into the README

Sorry one other thing , As the BMSFacebookAuthentcationManager and Google package , have there source file as a resource in the PodSpec the file is copied into the App package . now I'm not a expert on app store submission rules but It could raise issues having a un-compiled swift source file in your app package.

Now I hope I'm not coming across as a whing′er I know this is new SDK and under development I just love Bluemix and want to help if I can.

screen shot 2016-08-02 at 3 26 17 pm
screen shot 2016-08-02 at 3 26 24 pm
screen shot 2016-08-02 at 3 26 33 pm

Hi,
We're going to deprecate this repository soon (as well as the Google authentication manager). The source code will be added to BMSSecurity and commented out. The developers will need to uncomment the code and bring the FB or Google dependencies "manually".

Ok then I guess I can close this as its not really a issue I just didn't read the README.
Thanks for your help you have been more then helpful.