subject: Incorporating Google Api For Iphone Development [print this page] The Google Data APIs permit client software to gain access and also maneuver data hosted by the services of Google. Google Data APIs is a Cocoa structure that makes it possible for iPhone developers as well as the Mac OS X developers to simply write native applications by making use of Google Data APIs. This framework manages
Networking
XML generation and parsing
Query generation and Service-specific protocols
Sign-in for the Google accounts
The requirement of the Objective-C Client Library of the Google Data APIs is the iOS 3 or the Mac OS X 10.5 (also possible for later ones). The applications that run on the 10.4 of the Mac OS X could make use of the 10.4-friendly part. Some of the examples directory has example application that shows the typical interactions with the Google services making use of the framework. You need to understand that the applications normally acts as simple browsers intended for the framework of feed as well as the entry classes intended for each one of the service. The source file of these samples which is the WindowController has been written with standard Cocoa idioms in order to serve as the quick introductions to utilize the APIs.
The Objective-C Client Library of the Google Data APIs is offered as built framework, appropriate for the addition in a Mac application folder of a bundle Frameworks and also as a fixed library for iPhone development applications. On the other hand, the sources could also be assembled into an iPhone application development or even a Mac application.
How to link to Mac OS X Framework
In order to link to the Mac OS X Framework, the framework should be added to the Xcode project, drag the GData.framework to the Linked Frameworks of the project and then drag GData framework from a Linked Framework group folder to a Link Binary together with the Library phase within the application target.
Authorization and Authentication
Authentication can be defined as the confirmation the identity of a user through his username, password and any other possible data, for instance 2-step codes or captcha answers provided through a mobile phone. The process of authentication could be accomplished in one of these two ways:
ClientLogin is the older Google-exact protocol used for signing in a user by demanding their password and username. This system is responsible for safe storage of a password in a system keychain. You should be aware that the ClientLogin cant be used for a user account that has a 2-step verification system except the user decides to create application-specific password.
OAuth 2, the industry-standardized protocol that allows the server to validate a user by giving html login pages. Google Data API library make use of the authorization objected offered by controllers of the GTM OAuth 2. You can see some of the illustration applications for Docs, YouTube or Calendar for a display of the OAuth 2 sign-in. Also the OAuth 2 is a suggested way for managing sign-in.
Authorization can be defined as the application of access tokens designed for precise requests. The authorization of the API requested is managed by service class.
ClientLogin authorization which requires the password and the username to be supplied to a service classs setUserCredentialswithUsername:password: method
OAuth 2 authorization needs an OAuth2Authentication object be provided to the service classs setAuthorizer: method.