Using Google Drive Within Your Ios App. Guide ID: 5 - Draft: 2013-05-20 Cuesta-Cis-204
Total Page:16
File Type:pdf, Size:1020Kb
Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 cuesta-cis-204 Using Google Drive within your iOS app. Working with Google's Drive SDK, you will be able to add the ability to store and load data from a Google Drive into your iOS app. Written By: mebalzer This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 1 of 7 Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 INTRODUCTION Following the quick-start guide from Google, you will be able set up an account and add the Google client library to your XCode project, then run a sample based on the example given. This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 2 of 7 Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 Step 1 — Enable the Drive API Create an API project in the Google APIs Console. Select the Services tab in your API project, and enable the Drive API. Select the API Access tab in your API project, and click Create an OAuth 2.0 client ID. In the Branding Information section, provide a name for your application (e.g. "Drive Quickstart Sample"), and click Next. Providing a product logo is optional. In the Client ID Settings section, do the following: Select Installed application for the Application type Select Other for the Installed application type. Click Create Client ID. In the API Access page, locate the section Client ID for installed applications and note or copy the two pieces of information you'll need later to run the sample: the Client ID and the Client Secret. This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 3 of 7 Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 Step 2 — '''Install the Google Client Library''' To use the Google APIs Client Library for Objective-C start by downloading the source with SVN. svn checkout http://google-api- objectivec-client.goog... google-api-objectivec-client- read-only If you are using Mountain Lion, you will not have an svn command to use in the console. You must first go to Xcode and download the 'Command Line Tools.' Once this is completed, you can then copy and paste the svn checkout command in the link above. This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 4 of 7 Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 Step 3 — '''Create and Configure an XCode Project''' Make sure you actually drag at the top level of your folder structure for your GDL Demo to create a new work-space. It appears that there is a problem with the demo that does not include all of the Compile Sources if you drag the two GTLDrive files into the source file folder. Make sure you add GTLDrive_Sources.m to the Compile Sources in Build Phases Step 4 — Set up the sample Now that the project is created, you'll need to edit the view controller that was created for the project. This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 5 of 7 Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 Step 5 — Run the sample After you have set up your Google API project, installed the Google API client library, and set up the sample source code, the sample is ready to run. You can run the sample using the iPhone simulator or use a configured device. When running the sample on a simulator where no camera is available, the photo library is used instead. If needed, you can add photos to the library using the following steps: Drag an image from Finder on to the simulator. Click-hold on the image in Safari. Click Save Image to store the image in the photo library. When the sample runs for the first time, you'll be prompted to log in to your Google account and approve access. Once authorized, select an image from the library or take a photo to upload it to Google Drive. Once you have things working, try experimenting with other API methods. Or try the more detailed sample app to see more of the Drive API in action. This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 6 of 7 Using Google Drive within your iOS app. Guide ID: 5 - Draft: 2013-05-20 Step 6 — Optional: View a quickstart video Videos from the ongoing Drive Google Developers Live sessions cover the setup and running of each quickstart sample in detail. If you'd like to see the iOS quickstart sample demonstrated by some of the same developers who wrote it, click play, sit back, and enjoy. This document was generated on 2020-11-28 08:56:50 AM (MST). © 2020 cuesta-cis-204.dozuki.com/ Page 7 of 7.