2
0

Bump External dependencies.

This commit is contained in:
Maarten Billemont
2013-08-11 00:08:25 -04:00
parent 77439af486
commit 8375808cdc
224 changed files with 13810 additions and 2949 deletions

Binary file not shown.

View File

@@ -0,0 +1,59 @@
//
// GPPDeepLink.h
// Google+ iOS SDK
//
// Copyright 2012 Google Inc.
//
// Use of this SDK is subject to the Google+ Platform Terms of Service:
// https://developers.google.com/+/terms
//
#import <Foundation/Foundation.h>
@class GPPDeepLink;
// A protocol optionally implemented by the client of |GPPDeepLink|.
@protocol GPPDeepLinkDelegate
// Notifies the client that a deep link has been received either from
// |readDeepLinkAfterInstall| or |handleURL:sourceApplication:annotation:|.
- (void)didReceiveDeepLink:(GPPDeepLink *)deepLink;
@end
// This class handles a deep link within a share posted on Google+.
// For more information on deep links, see
// http://developers.google.com/+/mobile/ios/share .
@interface GPPDeepLink : NSObject
// Sets the delegate to handle the deep link.
+ (void)setDelegate:(id<GPPDeepLinkDelegate>)delegate;
// Returns a |GPPDeepLink| for your app to handle, or |nil| if not found. The
// deep-link ID can be obtained from |GPPDeepLink|. It is stored when a user
// clicks a link to your app from a Google+ post, but hasn't yet installed your
// app. The user will be redirected to the App Store to install your app. This
// method should be called on or near your app launch to take the user to
// deep-link ID within your app. The delegate will be called if set and if a
// deep link is found.
+ (GPPDeepLink *)readDeepLinkAfterInstall;
// This method should be called from your |UIApplicationDelegate|'s
// |application:openURL:sourceApplication:annotation|. Returns
// |GooglePlusDeepLink| if |GooglePlusDeepLink| handled this URL, |nil|
// otherwise. The delegate will be called if set and if a deep link is found.
// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|.
+ (GPPDeepLink *)handleURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation;
// The deep-link ID in |GPPDeepLink| that was passed to the app.
- (NSString *)deepLinkID;
// This instance method indicates where the user came from before arriving in
// your app. This method is provided for you to collect engagement metrics.
// For the possible values, see
// http://developers.google.com/+/mobile/ios/source-values .
- (NSString *)source;
@end

View File

@@ -0,0 +1,152 @@
//
// GPPShare.h
// Google+ iOS SDK
//
// Copyright 2012 Google Inc.
//
// Use of this SDK is subject to the Google+ Platform Terms of Service:
// https://developers.google.com/+/terms
//
// To allow a user to share with Google+, please follow these steps:
//
// 0. Create a project on Google API console,
// https://code.google.com/apis/console . Under "API Access", create a
// client ID as "Installed application" with the type "iOS", and
// register the bundle ID of your app.
//
// 1. Initialize the |GPPSignIn| instance with your registered client ID,
// and get the |GPPShare| instance.
//
// [[GPPSignIn shareInstance] setClientID:myClientID];
// GPPShare *gppShare = [GPPShare sharedInstance];
//
// 2. In the code where the share dialog will be opened,
//
// [[gppShare shareDialog] open];
//
// you can optionally call any of the |GPPShareBuilder| methods before
// calling |open|, for example, if there is a particular URL resource to be
// shared, or if you want to set text to prefill user comment in the share
// dialog, such as:
//
// NSURL *urlToShare = [NSURL URLWithString:@"http://www.google.com/"];
// NSString *prefillText = @"You probably already know this site...";
// [[[[gppShare shareDialog] setURLToShare:urlToShare]
// setPrefillText:prefillText] open];
//
// 3. In the '<YourApp>-info.plist' settings for your app, add a URL type to be
// handled by your app. Make the URL scheme the same as your app bundle ID.
//
// 4. In your application delegate, implement:
// - (BOOL)application:(NSString*)application
// openURL:(NSURL *)url
// sourceApplication:(NSString*)sourceApplication
// annotation:(id)annotation {
// if ([gppShare handleURL:url
// sourceApplication:sourceApplication
// annotation:annotation]) {
// return YES;
// }
// // Other handling code here...
// }
//
// 5. Optionally, if you want to be notified of the result of the share action,
// have a delegate class implement |GPPShareDelegate|, for example:
//
// @interface MyDelegateClass : NSObject<GPPShareDelegate>;
//
// - (void)finishedSharing:(BOOL)shared {
// // The share action was successful if |shared| is YES.
// }
//
// MyDelegateClass *myDelegate = [[MyDelegateClass alloc] init];
// gppShare.delegate = myDelegate;
#import <Foundation/Foundation.h>
@class GPPSignIn;
// The protocol to receive the result of the share action.
@protocol GPPShareDelegate
// Reports the status of the share action, |shared| is |YES| if user has
// successfully shared her post, |NO| otherwise, such as if the user canceled
// the post.
- (void)finishedSharing:(BOOL)shared;
@end
// The builder protocol to open the share dialog.
// For more information on sharing, see
// http://developers.google.com/+/mobile/ios/share .
@protocol GPPShareBuilder<NSCopying>
// Sets the URL resource to be shared.
- (id<GPPShareBuilder>)setURLToShare:(NSURL *)urlToShare;
// Sets the text to prefill user's comment in the share dialog.
- (id<GPPShareBuilder>)setPrefillText:(NSString *)prefillText;
// Sets the title, description, and thumbnail URL of the shared content preview
// in the share dialog. Only set these fields if you are sharing with a content
// deep link and don't have a URL resource. |title| is required.
- (id<GPPShareBuilder>)setTitle:(NSString *)title
description:(NSString *)description
thumbnailURL:(NSURL *)thumbnailURL;
// Sets the content deep-link ID that takes the user straight to your shared
// content. Only set this field if you want the content deep-linking feature.
// The content deep-link ID can either be a fully qualified URI, or URI path,
// which can be up to 512 characters in length.
- (id<GPPShareBuilder>)setContentDeepLinkID:(NSString *)contentDeepLinkID;
// Sets the call-to-action button of the shared content preview.
// The call-to-action button consists of a label, URL, and deep-link ID.
// The |label| is a string key defined under "data-calltoactionlabel" on
// http://developers.google.com/+/web/share/interactive#button_attr_calltoactionlabel
// that maps to the actual button text.
// The |url| is where the user is taken to after tapping on the button.
// The optional |deepLinkID| is the call-to-action deep-link ID that takes the
// user straight to a specific action in your app. It can either be a fully
// qualified URI, or URI path, which can be up to 512 characters in length.
// Note: In order to set the call-to-action button:
// 1. User must have been authenticated with scopes including
// "https://www.googleapis.com/auth/plus.login".
// 2. |setURLToShare:| must also be called.
- (id<GPPShareBuilder>)setCallToActionButtonWithLabel:(NSString *)label
URL:(NSURL *)url
deepLinkID:(NSString *)deepLinkID;
// Opens the share dialog. Returns |NO| if there was an error, |YES| otherwise.
- (BOOL)open;
@end
// The primary class for the share action on Google+.
// For more information on sharing, see
// http://developers.google.com/+/mobile/ios/share .
@interface GPPShare : NSObject
// The object to be notified when the share action has finished.
@property (nonatomic, assign) id<GPPShareDelegate> delegate;
// Returns a shared |GPPShare| instance.
// |[GPPSignIn sharedInstance].clientID| must be initialized with a client ID
// registered in the Google API console, https://code.google.com/apis/console/
// with the app's bundle ID.
+ (GPPShare *)sharedInstance;
// Returns a share dialog builder instance. Call its |open| method to
// create the dialog after setting the parameters as needed.
- (id<GPPShareBuilder>)shareDialog;
// This method should be called from your |UIApplicationDelegate|'s
// |application:openURL:sourceApplication:annotation|. Returns |YES| if
// |GPPShare| handled this URL.
// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|.
- (BOOL)handleURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation;
@end

View File

@@ -0,0 +1,158 @@
//
// GPPSignIn.h
// Google+ iOS SDK
//
// Copyright 2012 Google Inc.
//
// Use of this SDK is subject to the Google+ Platform Terms of Service:
// https://developers.google.com/+/terms
//
#import <Foundation/Foundation.h>
@class GTLServicePlus;
@class GTMOAuth2Authentication;
@class GTMOAuth2ViewControllerTouch;
// A protocol implemented by the client of |GPPSignIn| to receive a refresh
// token or an error.
@protocol GPPSignInDelegate
// The authorization has finished and is successful if |error| is |nil|.
- (void)finishedWithAuth:(GTMOAuth2Authentication *)auth
error:(NSError *)error;
// Finished disconnecting user from the app.
// The operation was successful if |error| is |nil|.
@optional
- (void)didDisconnectWithError:(NSError *)error;
@end
// This class signs the user in with Google. It provides single sign-on
// via the Google+ app (if installed), Chrome for iOS (if installed), or Mobile
// Safari.
//
// For reference, please see "Google+ Sign-In for iOS" at
// https://developers.google.com/+/mobile/ios/sign-in .
// Here is sample code to use |GPPSignIn|:
// 1) Get a reference to the |GPPSignIn| shared instance:
// GPPSignIn *signIn = [GPPSignIn sharedInstance];
// 2) Set the OAuth 2.0 scopes you want to request:
// [signIn setScopes:[NSArray arrayWithObject:
// @"https://www.googleapis.com/auth/plus.login"]];
// 2) Call [signIn setDelegate:self];
// 3) Set up delegate method |finishedWithAuth:error:|.
// 4) Call |handleURL| on the shared instance from |application:openUrl:...|
// in your app delegate.
// 5) Call [signIn authenticate];
@interface GPPSignIn : NSObject
// The authentication object for the current user, or |nil| if there is
// currently no logged in user.
@property (nonatomic, readonly) GTMOAuth2Authentication *authentication;
// The Google user ID. It is only available if |shouldFetchGoogleUserID| is set
// and either |trySilentAuthentication| or |authenticate| has been completed
// successfully.
@property (nonatomic, readonly) NSString *userID;
// The Google user's email. It is only available if |shouldFetchGoogleUserEmail|
// is set and either |trySilentAuthentication| or |authenticate| has been
// completed successfully.
@property (nonatomic, readonly) NSString *userEmail;
// The object to be notified when authentication is finished.
@property (nonatomic, assign) id<GPPSignInDelegate> delegate;
// All properties below are optional parameters. If they need to be set, set
// before calling |authenticate|.
// The client ID of the app from the Google APIs console.
// Must set for sign-in to work.
@property (nonatomic, copy) NSString *clientID;
// The API scopes requested by the app in an array of |NSString|s.
// The default value is |@[@"https://www.googleapis.com/auth/plus.login"]|.
@property (nonatomic, copy) NSArray *scopes;
// Whether or not to attempt Single-Sign-On when signing in.
// If |attemptSSO| is true, the sign-in button tries to authenticate with the
// Google+ application if it is installed. If false, it always uses Google+ via
// Chrome for iOS, if installed, or Mobile Safari for authentication.
// The default value is |YES|.
@property (nonatomic, assign) BOOL attemptSSO;
// The language for sign-in, in the form of ISO 639-1 language code
// optionally followed by a dash and ISO 3166-1 alpha-2 region code,
// such as |@"it"| or |@"pt-PT"|.
// Only set if different from system default.
@property (nonatomic, copy) NSString *language;
// Name of the keychain to save the sign-in state.
// Only set if a custom name needs to be used.
@property (nonatomic, copy) NSString *keychainName;
// An |NSString| array of moment types used by your app. Use values from the
// full list at
// https://developers.google.com/+/api/moment-types .
// such as "http://schemas.google.com/AddActivity".
// This property is required only for writing moments, with
// "https://www.googleapis.com/auth/plus.login" as a scope.
@property (nonatomic, copy) NSArray *actions;
// Whether or not to fetch user email after signing in. The email is saved in
// the |GTMOAuth2Authentication| object. Note that using this flag automatically
// adds "https://www.googleapis.com/auth/userinfo.email" scope to the request.
@property (nonatomic, assign) BOOL shouldFetchGoogleUserEmail;
// Whether or not to fetch user ID after signing in. The ID can be retrieved
// by |googleUserID| after user has been authenticated.
// Note, a scope, such as "https://www.googleapis.com/auth/plus.login" or
// "https://www.googleapis.com/auth/plus.me", that provides user ID must be
// included in |scopes| for this flag to work.
@property (nonatomic, assign) BOOL shouldFetchGoogleUserID;
// Returns a shared |GPPSignIn| instance.
+ (GPPSignIn *)sharedInstance;
// Checks whether the user has either currently signed in or has previous
// authentication saved in keychain.
- (BOOL)hasAuthInKeychain;
// Attempts to authenticate silently without user interaction.
// Returns |YES| and calls the delegate if the user has either currently signed
// in or has previous authentication saved in keychain.
// Note that if the previous authentication was revoked by the user, this method
// still returns |YES| but |finishedWithAuth:error:| callback will indicate
// that authentication has failed.
- (BOOL)trySilentAuthentication;
// Starts the authentication process. Set |attemptSSO| to try single sign-on.
// If |attemptSSO| is true, try to authenticate with the Google+ app, if
// installed. If false, always use Google+ via Chrome or Mobile Safari for
// authentication. The delegate will be called at the end of this process.
- (void)authenticate;
// This method should be called from your |UIApplicationDelegate|'s
// |application:openURL:sourceApplication:annotation|. Returns |YES| if
// |GPPSignIn| handled this URL.
// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|.
- (BOOL)handleURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation;
// Removes the OAuth 2.0 token from the keychain.
- (void)signOut;
// Disconnects the user from the app and revokes previous authentication.
// If the operation succeeds, the OAuth 2.0 token is also removed from keychain.
// The token is needed to disconnect so do not call |signOut| if |disconnect| is
// to be called.
- (void)disconnect;
// Gets a service object which can execute "queries", for example,
// to get list of people that is visible to this app.
- (GTLServicePlus *)plusService;
@end

View File

@@ -0,0 +1,44 @@
//
// GPPSignInButton.h
// Google+ iOS SDK
//
// Copyright 2012 Google Inc.
//
// Use of this SDK is subject to the Google+ Platform Terms of Service:
// https://developers.google.com/+/terms
//
#import <UIKit/UIKit.h>
// The various layout styles supported by the GPPSignInButton.
// The minmum size of the button depends on the language used for text.
// The following dimensions (in points) fit for all languages:
// kGPPSignInButtonStyleStandard: 226 x 48
// kGPPSignInButtonStyleWide: 308 x 48
// kGPPSignInButtonStyleIconOnly: 46 x 48 (no text, fixed size)
typedef enum {
kGPPSignInButtonStyleStandard = 0,
kGPPSignInButtonStyleWide = 1,
kGPPSignInButtonStyleIconOnly = 2
} GPPSignInButtonStyle;
// The various color schemes supported by the GPPSignInButton.
typedef enum {
kGPPSignInButtonColorSchemeDark = 0,
kGPPSignInButtonColorSchemeLight = 1
} GPPSignInButtonColorScheme;
// This class provides the Google+ sign-in button. You can instantiate this
// class programmatically or from a NIB file. You should set up the
// |GPPSignIn| shared instance with your client ID and any additional scopes,
// implement the delegate methods for |GPPSignIn|, and add this button to your
// view hierarchy.
@interface GPPSignInButton : UIButton
// Sets the sign-in button layout style. The default style is standard.
- (void)setStyle:(GPPSignInButtonStyle)style;
// Sets the sign-in button color scheme. The default scheme is dark.
- (void)setColorScheme:(GPPSignInButtonColorScheme)colorScheme;
@end

View File

@@ -0,0 +1,25 @@
//
// GPPURLHandler.h
// Google+ iOS SDK
//
// Copyright 2013 Google Inc.
//
// Use of this SDK is subject to the Google+ Platform Terms of Service:
// https://developers.google.com/+/terms
//
#import <Foundation/Foundation.h>
@interface GPPURLHandler : NSObject
// Calls |handleURL:sourceApplication:annotation:| for
// |[GPPSignIn sharedInstance]|, |[GPPShare sharedInstance]|, and
// |GPPDeepLink|, and returns |YES| if any of them handles the URL.
// This method can be called from your |UIApplicationDelegate|'s
// |application:openURL:sourceApplication:annotation| instead of calling
// those methods individually.
+ (BOOL)handleURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation;
@end

View File

@@ -0,0 +1,16 @@
//
// GooglePlus.h
// Google+ iOS SDK
//
// Copyright 2013 Google Inc.
//
// Use of this SDK is subject to the Google+ Platform Terms of Service:
// https://developers.google.com/+/terms
//
// G+ SDK.
#import "GPPDeepLink.h"
#import "GPPShare.h"
#import "GPPSignIn.h"
#import "GPPSignInButton.h"
#import "GPPURLHandler.h"