0

I'm trying to import the cocoalibspotify into my Xcode project. https://github.com/spotify/cocoalibspotify

However I am completly lost to what files need to be imported and how. I'm still a beginner and the sparse info on the spotify website doesn't really help me. I did manage to run the Simple Player sample project though and I tried looking at what files are imported. But I didn't get very far with this.

I tried importing the following files that come with the zip by dragging these into my project:

  • CocoaLibSpotify iOS Library.xcodeproj
  • CocoaLibSpotify iOS Library-Prefix.pch
  • SPLoginResources.bundle
  • CocoaLibSpotify iOS Test Container (folder)
  • View Controllers (folder)

after doing that however, my project simply won't compile anymore. I'm getting all kinds of errors. I'm guessing these are related to setting the wrong target???

enter image description here

the website does mention a couple more instructions for iOS when you scroll down on the page https://github.com/spotify/cocoalibspotify

I did manage to import the frameworks but the other stuff is beyond me.

So if anyone is willing to guide me through this, that would be great!


EDIT:

I think I'm getting closer. I've created a ".a" file by opening the "CocoaLibSpotify iOS Library.xcodeproj " and making a build. then I import the resulting libCocoaLibSpotify.a file and also a folder called "include" which has a lot of header files.

Ramin Afshar
  • 989
  • 2
  • 18
  • 34

1 Answers1

4

You only need to include the CocoaLibSpotify iOS Library.xcodeproj file in your project.

Once you've done that, make sure CocoaLibSpotify is added in the "Target Dependencies" and "Link Binary with Libraries" build phases of your project by clicking the '+' button in each of those phases and choosing it from the list.

Other than that, make sure you closely follow the instructions in the "Building - iOS" section of CocoaLibSpotify's README.markdown file and you'll be set.

iKenndac
  • 18,730
  • 3
  • 35
  • 51