Google Drive Integration in iOS Apps
Hey guys, I have been trying to integrate Google Drive in one of my projects, thought about sharing a blog post regarding the same...
So lets get started...
Create a new project / open existing project in XCode.
Clone or Add Submodule the Google API Client Library
Now you need to add GTL.xcodeproj to your project. You will notice the entire project is copied. If not, then close all the projects and only open the project in which you want to integrate Google Drive API
Now, select your project from the Project Navigator, select your Target and go to Build Phases
Now add a new Item libGTLTouchstaticLib.a to the linked binaries. And also add SystemConfiguration.framework and Security.framework
After that you need to do one important thing, that is telling the xcode where to search for the header files. For that we need to add one entry to the "Header Search Paths" in "Build Settings". Now considering that you have saved the Google API Client Library in the Root Directory of your project, add the following line "$SRCROOT/google-api-objectivec-client/Source" and make sure to put a check mark for recursive search for header files.
Now open the Google API Client Library in Finder, and go to the following path "~/Source/Services/Drive/Generated", you will see all the files which we need for GoogleDrive Integration. Note this files are not included in GTL.xcodeproject, thus we need to add them manually to our project.
In your project create one more folder named GoogleDrive or whatever you like, and Add those Google Drive files to your newly created folder.
Similarly you can integrate any other Google Services in your project.
Now #import "GTLFramework.h" and compile it, the build should succeed, incase if it fails check if you have missed something or else I am at your service :)
Once the build is succeeded, in order to proceed further, we need to go Google API Console. Create an App.
Go to Services, switch ON the "Drive API".
Go to API Access and click on "Create an OAuth 2.0 Client ID" and follow the steps.
If all the steps are done successfully, then CHEERS!!! GOOD JOB!!!
In my upcoming post, we will see how to get started with the Google API Client library which we just successfully integrated with our project... Stay tuned :) :)















