2
0

Update Google+ integration.

[UPDATED]   Google+ SDK to 1.1.0.
This commit is contained in:
Maarten Billemont
2013-01-31 16:22:37 -05:00
parent cc015ada1b
commit 6c23134e47
74 changed files with 3383 additions and 2012 deletions

View File

@@ -24,13 +24,12 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
#import "GTLPlusConstants.h"
#import "GTLPlusItemScope.h"
#import "GTLPlusMoment.h"
#import "GTLPlusPerson.h"
#import "GTLQueryPlus.h"
#import "GTLServicePlus.h"

View File

@@ -24,7 +24,7 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
#import <Foundation/Foundation.h>
@@ -36,11 +36,9 @@
// Authorization scope
// Know who you are on Google
GTL_EXTERN NSString * const kGTLAuthScopePlusMe; // "https://www.googleapis.com/auth/plus.me"
// View and manage user activity information in Google+
GTL_EXTERN NSString * const kGTLAuthScopePlusMomentsWrite; // "https://www.googleapis.com/auth/plus.moments.write"
// View your email address
GTL_EXTERN NSString * const kGTLAuthScopePlusUserinfoEmail; // "https://www.googleapis.com/auth/userinfo.email"
GTL_EXTERN NSString * const kGTLAuthScopePlusMe; // "https://www.googleapis.com/auth/plus.me"
// Send your activity to your private Google+ history
GTL_EXTERN NSString * const kGTLAuthScopePlusMomentsWrite; // "https://www.googleapis.com/auth/plus.moments.write"
// Collection
GTL_EXTERN NSString * const kGTLPlusCollectionVault; // "vault"

View File

@@ -24,14 +24,13 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
#import "GTLPlusConstants.h"
// Authorization scope
NSString * const kGTLAuthScopePlusMe = @"https://www.googleapis.com/auth/plus.me";
NSString * const kGTLAuthScopePlusMomentsWrite = @"https://www.googleapis.com/auth/plus.moments.write";
NSString * const kGTLAuthScopePlusUserinfoEmail = @"https://www.googleapis.com/auth/userinfo.email";
NSString * const kGTLAuthScopePlusMe = @"https://www.googleapis.com/auth/plus.me";
NSString * const kGTLAuthScopePlusMomentsWrite = @"https://www.googleapis.com/auth/plus.moments.write";
// Collection
NSString * const kGTLPlusCollectionVault = @"vault";

View File

@@ -24,7 +24,7 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLPlusItemScope (0 custom class methods, 55 custom properties)
@@ -169,11 +169,11 @@
// belongs to.
@property (retain) GTLPlusItemScope *partOfTVSeries;
// The main performer or performers of the eventfor example, a presenter,
// The main performer or performers of the event-for example, a presenter,
// musician, or actor.
@property (retain) NSArray *performers; // of GTLPlusItemScope
// Player type requiredfor example, Flash or Silverlight.
// Player type required-for example, Flash or Silverlight.
@property (copy) NSString *playerType;
// Postal code.
@@ -186,7 +186,7 @@
@property (copy) NSString *ratingValue;
// Review rating.
@property (retain) NSArray *reviewRating; // of GTLPlusItemScope
@property (retain) GTLPlusItemScope *reviewRating;
// The start date and time of the event (in ISO 8601 date format).
@property (copy) NSString *startDate;
@@ -213,7 +213,7 @@
// The item type.
@property (copy) NSString *type;
// A url for this scope.
// A URL for the item upon which the action was performed.
@property (copy) NSString *url;
// The width of the media object.

View File

@@ -24,7 +24,7 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLPlusItemScope (0 custom class methods, 55 custom properties)
@@ -66,7 +66,6 @@
[GTLPlusItemScope class], @"author",
[GTLPlusItemScope class], @"contributor",
[GTLPlusItemScope class], @"performers",
[GTLPlusItemScope class], @"reviewRating",
nil];
return map;
}

View File

@@ -24,10 +24,9 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLPlusMoment (0 custom class methods, 6 custom properties)
// GTLPlusMomentVerb (0 custom class methods, 1 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLObject.h"
@@ -36,7 +35,6 @@
#endif
@class GTLPlusItemScope;
@class GTLPlusMomentVerb;
// ----------------------------------------------------------------------------
//
@@ -45,35 +43,23 @@
@interface GTLPlusMoment : GTLObject
// The moment ID.
// identifier property maps to 'id' in JSON (to avoid Objective C's 'id').
@property (copy) NSString *identifier;
// Identifies this resource as a moment.
@property (copy) NSString *kind;
// The object generated by performing the action on the item
@property (retain) GTLPlusItemScope *result;
// Timestamp of the action (when it occured) in RFC3339 format.
// Time stamp of when the action occurred in RFC3339 format.
@property (retain) GTLDateTime *startDate;
// The object on which the action was performed
// The object on which the action was performed.
@property (retain) GTLPlusItemScope *target;
// The schema.org activity type
// The schema.org activity type.
@property (copy) NSString *type;
// The action the user performed
@property (retain) GTLPlusMomentVerb *verb;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusMomentVerb
//
@interface GTLPlusMomentVerb : GTLObject
// Url name of the verb
@property (copy) NSString *url;
@end

View File

@@ -24,10 +24,9 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLPlusMoment (0 custom class methods, 6 custom properties)
// GTLPlusMomentVerb (0 custom class methods, 1 custom properties)
#import "GTLPlusMoment.h"
@@ -39,20 +38,17 @@
//
@implementation GTLPlusMoment
@dynamic kind, result, startDate, target, type, verb;
@dynamic identifier, kind, result, startDate, target, type;
+ (NSDictionary *)propertyToJSONKeyMap {
NSDictionary *map =
[NSDictionary dictionaryWithObject:@"id"
forKey:@"identifier"];
return map;
}
+ (void)load {
[self registerObjectClassForKind:@"plus#moment"];
}
@end
// ----------------------------------------------------------------------------
//
// GTLPlusMomentVerb
//
@implementation GTLPlusMomentVerb
@dynamic url;
@end

View File

@@ -1,285 +0,0 @@
/* Copyright (c) 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLPlusPerson.h
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Google+ API (plus/v1moments)
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// Classes:
// GTLPlusPerson (0 custom class methods, 21 custom properties)
// GTLPlusPersonEmailsItem (0 custom class methods, 3 custom properties)
// GTLPlusPersonImage (0 custom class methods, 1 custom properties)
// GTLPlusPersonName (0 custom class methods, 6 custom properties)
// GTLPlusPersonOrganizationsItem (0 custom class methods, 9 custom properties)
// GTLPlusPersonPlacesLivedItem (0 custom class methods, 2 custom properties)
// GTLPlusPersonUrlsItem (0 custom class methods, 3 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLObject.h"
#else
#import "GTLObject.h"
#endif
@class GTLPlusPersonEmailsItem;
@class GTLPlusPersonImage;
@class GTLPlusPersonName;
@class GTLPlusPersonOrganizationsItem;
@class GTLPlusPersonPlacesLivedItem;
@class GTLPlusPersonUrlsItem;
// ----------------------------------------------------------------------------
//
// GTLPlusPerson
//
@interface GTLPlusPerson : GTLObject
// A short biography for this person.
@property (copy) NSString *aboutMe;
// The person's date of birth, represented as YYYY-MM-DD.
@property (copy) NSString *birthday;
// The current location for this person.
@property (copy) NSString *currentLocation;
// The name of this person, suitable for display.
@property (copy) NSString *displayName;
// A list of email addresses for this person.
@property (retain) NSArray *emails; // of GTLPlusPersonEmailsItem
// ETag of this response for caching purposes.
@property (copy) NSString *ETag;
// The person's gender. Possible values are:
// - "male" - Male gender.
// - "female" - Female gender.
// - "other" - Other.
@property (copy) NSString *gender;
// If "true", indicates that the person has installed the app that is making the
// request and has chosen to expose this install state to the caller. A value of
// "false" indicates that the install state cannot be determined (it is either
// not installed or the person has chosen to keep this information private).
@property (retain) NSNumber *hasApp; // boolValue
// The ID of this person.
// identifier property maps to 'id' in JSON (to avoid Objective C's 'id').
@property (copy) NSString *identifier;
// The representation of the person's profile photo.
@property (retain) GTLPlusPersonImage *image;
// Identifies this resource as a person. Value: "plus#person".
@property (copy) NSString *kind;
// The languages spoken by this person.
@property (retain) NSArray *languagesSpoken; // of NSString
// An object representation of the individual components of a person's name.
@property (retain) GTLPlusPersonName *name;
// The nickname of this person.
@property (copy) NSString *nickname;
// Type of person within Google+. Possible values are:
// - "person" - represents an actual person.
// - "page" - represents a page.
@property (copy) NSString *objectType;
// A list of current or past organizations with which this person is associated.
@property (retain) NSArray *organizations; // of GTLPlusPersonOrganizationsItem
// A list of places where this person has lived.
@property (retain) NSArray *placesLived; // of GTLPlusPersonPlacesLivedItem
// The person's relationship status. Possible values are:
// - "single" - Person is single.
// - "in_a_relationship" - Person is in a relationship.
// - "engaged" - Person is engaged.
// - "married" - Person is married.
// - "its_complicated" - The relationship is complicated.
// - "open_relationship" - Person is in an open relationship.
// - "widowed" - Person is widowed.
// - "in_domestic_partnership" - Person is in a domestic partnership.
// - "in_civil_union" - Person is in a civil union.
@property (copy) NSString *relationshipStatus;
// The brief description (tagline) of this person.
@property (copy) NSString *tagline;
// The URL of this person's profile.
@property (copy) NSString *url;
// A list of URLs for this person.
@property (retain) NSArray *urls; // of GTLPlusPersonUrlsItem
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonEmailsItem
//
@interface GTLPlusPersonEmailsItem : GTLObject
// If "true", indicates this email address is the person's primary one.
@property (retain) NSNumber *primary; // boolValue
// The type of address. Possible values are:
// - "home" - Home email address.
// - "work" - Work email address.
// - "other" - Other.
@property (copy) NSString *type;
// The email address.
@property (copy) NSString *value;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonImage
//
@interface GTLPlusPersonImage : GTLObject
// The URL of the person's profile photo. To re-size the image and crop it to a
// square, append the query string ?sz=x, where x is the dimension in pixels of
// each side.
@property (copy) NSString *url;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonName
//
@interface GTLPlusPersonName : GTLObject
// The family name (last name) of this person.
@property (copy) NSString *familyName;
// The full name of this person, including middle names, suffixes, etc.
@property (copy) NSString *formatted;
// The given name (first name) of this person.
@property (copy) NSString *givenName;
// The honorific prefixes (such as "Dr." or "Mrs.") for this person.
@property (copy) NSString *honorificPrefix;
// The honorific suffixes (such as "Jr.") for this person.
@property (copy) NSString *honorificSuffix;
// The middle name of this person.
@property (copy) NSString *middleName;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonOrganizationsItem
//
@interface GTLPlusPersonOrganizationsItem : GTLObject
// The department within the organization.
@property (copy) NSString *department;
// A short description of the person's role in this organization.
// Remapped to 'descriptionProperty' to avoid NSObject's 'description'.
@property (copy) NSString *descriptionProperty;
// The date the person left this organization.
@property (copy) NSString *endDate;
// The location of this organization.
@property (copy) NSString *location;
// The name of the organization.
@property (copy) NSString *name;
// If "true", indicates this organization is the person's primary one (typically
// interpreted as current one).
@property (retain) NSNumber *primary; // boolValue
// The date the person joined this organization.
@property (copy) NSString *startDate;
// The person's job title or role within the organization.
@property (copy) NSString *title;
// The type of organization. Possible values are:
// - "work" - Work.
// - "school" - School.
@property (copy) NSString *type;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonPlacesLivedItem
//
@interface GTLPlusPersonPlacesLivedItem : GTLObject
// If "true", this place of residence is this person's primary residence.
@property (retain) NSNumber *primary; // boolValue
// A place where this person has lived. For example: "Seattle, WA", "Near
// Toronto".
@property (copy) NSString *value;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonUrlsItem
//
@interface GTLPlusPersonUrlsItem : GTLObject
// If "true", this URL is the person's primary URL.
@property (retain) NSNumber *primary; // boolValue
// The type of URL. Possible values are:
// - "home" - URL for home.
// - "work" - URL for work.
// - "blog" - URL for blog.
// - "profile" - URL for profile.
// - "other" - Other.
@property (copy) NSString *type;
// The URL value.
@property (copy) NSString *value;
@end

View File

@@ -1,145 +0,0 @@
/* Copyright (c) 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLPlusPerson.m
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Google+ API (plus/v1moments)
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// Classes:
// GTLPlusPerson (0 custom class methods, 21 custom properties)
// GTLPlusPersonEmailsItem (0 custom class methods, 3 custom properties)
// GTLPlusPersonImage (0 custom class methods, 1 custom properties)
// GTLPlusPersonName (0 custom class methods, 6 custom properties)
// GTLPlusPersonOrganizationsItem (0 custom class methods, 9 custom properties)
// GTLPlusPersonPlacesLivedItem (0 custom class methods, 2 custom properties)
// GTLPlusPersonUrlsItem (0 custom class methods, 3 custom properties)
#import "GTLPlusPerson.h"
// ----------------------------------------------------------------------------
//
// GTLPlusPerson
//
@implementation GTLPlusPerson
@dynamic aboutMe, birthday, currentLocation, displayName, emails, ETag, gender,
hasApp, identifier, image, kind, languagesSpoken, name, nickname,
objectType, organizations, placesLived, relationshipStatus, tagline,
url, urls;
+ (NSDictionary *)propertyToJSONKeyMap {
NSDictionary *map =
[NSDictionary dictionaryWithObjectsAndKeys:
@"etag", @"ETag",
@"id", @"identifier",
nil];
return map;
}
+ (NSDictionary *)arrayPropertyToClassMap {
NSDictionary *map =
[NSDictionary dictionaryWithObjectsAndKeys:
[GTLPlusPersonEmailsItem class], @"emails",
[NSString class], @"languagesSpoken",
[GTLPlusPersonOrganizationsItem class], @"organizations",
[GTLPlusPersonPlacesLivedItem class], @"placesLived",
[GTLPlusPersonUrlsItem class], @"urls",
nil];
return map;
}
+ (void)load {
[self registerObjectClassForKind:@"plus#person"];
}
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonEmailsItem
//
@implementation GTLPlusPersonEmailsItem
@dynamic primary, type, value;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonImage
//
@implementation GTLPlusPersonImage
@dynamic url;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonName
//
@implementation GTLPlusPersonName
@dynamic familyName, formatted, givenName, honorificPrefix, honorificSuffix,
middleName;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonOrganizationsItem
//
@implementation GTLPlusPersonOrganizationsItem
@dynamic department, descriptionProperty, endDate, location, name, primary,
startDate, title, type;
+ (NSDictionary *)propertyToJSONKeyMap {
NSDictionary *map =
[NSDictionary dictionaryWithObject:@"description"
forKey:@"descriptionProperty"];
return map;
}
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonPlacesLivedItem
//
@implementation GTLPlusPersonPlacesLivedItem
@dynamic primary, value;
@end
// ----------------------------------------------------------------------------
//
// GTLPlusPersonUrlsItem
//
@implementation GTLPlusPersonUrlsItem
@dynamic primary, type, value;
@end

View File

@@ -24,9 +24,9 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLQueryPlus (2 custom class methods, 4 custom properties)
// GTLQueryPlus (1 custom class methods, 4 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLQuery.h"
@@ -59,32 +59,18 @@
// Method: plus.moments.insert
// Record a user activity (e.g Bill watched a video on Youtube)
// Required:
// userId: The ID of the user to get activities for. The special value "me"
// can be used to indicate the authenticated user.
// userId: The ID of the user to record activities for. The only valid values
// are "me" and the ID of the authenticated user.
// collection: The collection to which to write moments.
// kGTLPlusCollectionVault: The default collection for writing new moments.
// Optional:
// debug: Return the moment as written. Should be used only for debugging.
// Authorization scope(s):
// kGTLAuthScopePlusMe
// kGTLAuthScopePlusMomentsWrite
// Fetches a GTLPlusMoment.
+ (id)queryForMomentsInsertWithObject:(GTLPlusMoment *)object
userId:(NSString *)userId
collection:(NSString *)collection;
#pragma mark -
#pragma mark "people" methods
// These create a GTLQueryPlus object.
// Method: plus.people.get
// Get a person's profile.
// Required:
// userId: The ID of the person to get the profile for. The special value "me"
// can be used to indicate the authenticated user.
// Authorization scope(s):
// kGTLAuthScopePlusMe
// kGTLAuthScopePlusUserinfoEmail
// Fetches a GTLPlusPerson.
+ (id)queryForPeopleGetWithUserId:(NSString *)userId;
@end

View File

@@ -24,14 +24,13 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLQueryPlus (2 custom class methods, 4 custom properties)
// GTLQueryPlus (1 custom class methods, 4 custom properties)
#import "GTLQueryPlus.h"
#import "GTLPlusMoment.h"
#import "GTLPlusPerson.h"
@implementation GTLQueryPlus
@@ -57,16 +56,4 @@
return query;
}
#pragma mark -
#pragma mark "people" methods
// These create a GTLQueryPlus object.
+ (id)queryForPeopleGetWithUserId:(NSString *)userId {
NSString *methodName = @"plus.people.get";
GTLQueryPlus *query = [self queryWithMethodName:methodName];
query.userId = userId;
query.expectedObjectClass = [GTLPlusPerson class];
return query;
}
@end

View File

@@ -24,7 +24,7 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLServicePlus (0 custom class methods, 0 custom properties)

View File

@@ -24,7 +24,7 @@
// Description:
// The Google+ API enables developers to build on top of the Google+ platform.
// Documentation:
// http://developers.google.com/+/api/
// https://developers.google.com/+/history/
// Classes:
// GTLServicePlus (0 custom class methods, 0 custom properties)
@@ -40,7 +40,6 @@
[GTLQueryPlus class],
[GTLPlusItemScope class],
[GTLPlusMoment class],
[GTLPlusPerson class],
nil];
return classes;
}