Monday, June 30, 2014

Videos from youtube channel in iOS app (part 1)


1. Download Google Objective C Client. For developing any iOS application, that use some of Google APIs, we need to have Google libraries downloaded. In terminal run this command:
svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/ google-api-objectivec-client-read-only
2. Build library. From downloaded items in Source folder open GTL.xcodeproj and choose iOS simulator and GTLTouchStaticLib as target. Then build library again, this time for iOS device. From Organizer>Products go to derived data by clicking arrow:


From Build>Products>Debug-iphoneos copy to e.g Desktop libGTLTouchStaticLib.a and rename it to e.g. libGTLTouchStaticLib1.a. Do the same for the file from Build>Products>Debug-iphonesimulator and rename it to libGTLTouchStaticLib2. With this command in Terminal, build fat static library


lipo -create -output libGTLTouchStaticLib.a libGTLTouchStaticLib1.a libGTLTouchStaticLib2.a


3. Adding source files for the library. Find header files in Source>Services>Youtube>Generated and add them to project (select: copy items into destination group's folder and create groups for any added folders). However, you don't need GTLYouTube_Sources.m file, so you should deleted it. From Derived Data folder: Build>Products>Debug-iphoneos add Headers folder to the project.

4. Adding frameworks and libraries. Add Security.framework, SystemConfiguration.framework and libGTLTouchStaticLib.a to project.

Now you can run your application on both iOS device and simulator, and start using Google Youtube API for fetching videos.

1 comment:

  1. hi man, can you add more details for step 3. Is not very clear for me.

    Thanks

    ReplyDelete