├── .gitignore ├── src ├── ios │ ├── libs │ │ ├── GooglePlus.framework │ │ │ ├── Versions │ │ │ │ ├── Current │ │ │ │ └── A │ │ │ │ │ ├── GooglePlus │ │ │ │ │ └── Headers │ │ │ │ │ ├── GooglePlus.h │ │ │ │ │ ├── GPPURLHandler.h │ │ │ │ │ ├── GPPSignInButton.h │ │ │ │ │ ├── GPPDeepLink.h │ │ │ │ │ ├── GPPSignIn.h │ │ │ │ │ └── GPPShare.h │ │ │ ├── Headers │ │ │ └── GooglePlus │ │ └── GoogleOpenSource.framework │ │ │ ├── Versions │ │ │ ├── Current │ │ │ └── A │ │ │ │ ├── GoogleOpenSource │ │ │ │ └── Headers │ │ │ │ ├── GTMGarbageCollection.h │ │ │ │ ├── GTLBase64.h │ │ │ │ ├── GTLFramework.h │ │ │ │ ├── GoogleOpenSource.h │ │ │ │ ├── GTLJSONParser.h │ │ │ │ ├── GTLPlus.h │ │ │ │ ├── GTLErrorObject.h │ │ │ │ ├── GTMNSDictionary+URLArguments.h │ │ │ │ ├── GTMNSString+URLArguments.h │ │ │ │ ├── GTLBatchQuery.h │ │ │ │ ├── GTLBatchResult.h │ │ │ │ ├── GTLRuntimeCommon.h │ │ │ │ ├── GTLPlusAcl.h │ │ │ │ ├── GTLServicePlus.h │ │ │ │ ├── GTLPlusMoment.h │ │ │ │ ├── GTLDateTime.h │ │ │ │ ├── GTLPlusAclentryResource.h │ │ │ │ ├── GTLUploadParameters.h │ │ │ │ ├── GTLPlusMomentsFeed.h │ │ │ │ ├── GTLPlusCommentFeed.h │ │ │ │ ├── GTLPlusPlace.h │ │ │ │ ├── GTLPlusPeopleFeed.h │ │ │ │ ├── GTLPlusConstants.h │ │ │ │ ├── GTLPlusActivityFeed.h │ │ │ │ ├── GTLTargetNamespace.h │ │ │ │ ├── OpenInChromeController.h │ │ │ │ ├── GTLUtilities.h │ │ │ │ ├── GTMMethodCheck.h │ │ │ │ ├── GTMHTTPFetcherLogging.h │ │ │ │ ├── GTLDefines.h │ │ │ │ ├── GTMHTTPFetcherService.h │ │ │ │ ├── GTLQuery.h │ │ │ │ ├── GTMObjC2Runtime.h │ │ │ │ ├── GTMHTTPUploadFetcher.h │ │ │ │ ├── GTLPlusComment.h │ │ │ │ ├── GTMHTTPFetchHistory.h │ │ │ │ ├── GTMOAuth2SignIn.h │ │ │ │ ├── GTLObject.h │ │ │ │ ├── GTLPlusItemScope.h │ │ │ │ ├── GTLQueryPlus.h │ │ │ │ └── GTMOAuth2Authentication.h │ │ │ ├── Headers │ │ │ └── GoogleOpenSource │ ├── GooglePlus.h │ └── GooglePlus.m └── android │ └── GooglePlus.java ├── demo ├── README.md └── index.html ├── screenshots ├── iOS1.png ├── iOS2.png ├── iOS3.png ├── Android1.png ├── Android2.png └── Android3.png ├── www └── GooglePlus.js ├── plugin.xml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/GooglePlus: -------------------------------------------------------------------------------- 1 | Versions/Current/GooglePlus -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | Create a project with the Cordova CLI and copy over this index.html file -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/GoogleOpenSource: -------------------------------------------------------------------------------- 1 | Versions/Current/GoogleOpenSource -------------------------------------------------------------------------------- /screenshots/iOS1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/screenshots/iOS1.png -------------------------------------------------------------------------------- /screenshots/iOS2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/screenshots/iOS2.png -------------------------------------------------------------------------------- /screenshots/iOS3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/screenshots/iOS3.png -------------------------------------------------------------------------------- /screenshots/Android1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/screenshots/Android1.png -------------------------------------------------------------------------------- /screenshots/Android2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/screenshots/Android2.png -------------------------------------------------------------------------------- /screenshots/Android3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/screenshots/Android3.png -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/GooglePlus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/src/ios/libs/GooglePlus.framework/Versions/A/GooglePlus -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/GoogleOpenSource: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-plugin-googleplus/master/src/ios/libs/GoogleOpenSource.framework/Versions/A/GoogleOpenSource -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMGarbageCollection.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file previously included utility functions for working 3 | // with Garbage Collection on Mac OS X. 4 | // 5 | -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/Headers/GooglePlus.h: -------------------------------------------------------------------------------- 1 | // 2 | // GooglePlus.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2013 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | // G+ SDK. 12 | #import "GPPDeepLink.h" 13 | #import "GPPShare.h" 14 | #import "GPPSignIn.h" 15 | #import "GPPSignInButton.h" 16 | #import "GPPURLHandler.h" 17 | -------------------------------------------------------------------------------- /src/ios/GooglePlus.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface GooglePlus : CDVPlugin 5 | 6 | @property (nonatomic, copy) NSString* callbackId; 7 | @property (nonatomic, assign) BOOL isSigningIn; 8 | 9 | - (void) login:(CDVInvokedUrlCommand*)command; 10 | - (void) trySilentLogin:(CDVInvokedUrlCommand*)command; 11 | - (void) logout:(CDVInvokedUrlCommand*)command; 12 | - (void) disconnect:(CDVInvokedUrlCommand*)command; 13 | - (void) share_unused:(CDVInvokedUrlCommand*)command; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/Headers/GPPURLHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPPURLHandler.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2013 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | #import 12 | 13 | @interface GPPURLHandler : NSObject 14 | 15 | // Calls |handleURL:sourceApplication:annotation:| for 16 | // |[GPPSignIn sharedInstance]|, |[GPPShare sharedInstance]|, and 17 | // |GPPDeepLink|, and returns |YES| if any of them handles the URL. 18 | // This method can be called from your |UIApplicationDelegate|'s 19 | // |application:openURL:sourceApplication:annotation| instead of calling 20 | // those methods individually. 21 | + (BOOL)handleURL:(NSURL *)url 22 | sourceApplication:(NSString *)sourceApplication 23 | annotation:(id)annotation; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /www/GooglePlus.js: -------------------------------------------------------------------------------- 1 | function GooglePlus() { 2 | } 3 | 4 | GooglePlus.prototype.login = function (options, successCallback, errorCallback) { 5 | cordova.exec(successCallback, errorCallback, "GooglePlus", "login", [options]); 6 | }; 7 | 8 | GooglePlus.prototype.trySilentLogin = function (options, successCallback, errorCallback) { 9 | cordova.exec(successCallback, errorCallback, "GooglePlus", "trySilentLogin", [options]); 10 | }; 11 | 12 | GooglePlus.prototype.logout = function (successCallback, errorCallback) { 13 | cordova.exec(successCallback, errorCallback, "GooglePlus", "logout", []); 14 | }; 15 | 16 | GooglePlus.prototype.disconnect = function (successCallback, errorCallback) { 17 | cordova.exec(successCallback, errorCallback, "GooglePlus", "disconnect", []); 18 | }; 19 | 20 | GooglePlus.install = function () { 21 | if (!window.plugins) { 22 | window.plugins = {}; 23 | } 24 | 25 | window.plugins.googleplus = new GooglePlus(); 26 | return window.plugins.googleplus; 27 | }; 28 | 29 | cordova.addConstructor(GooglePlus.install); -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLBase64.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #import 17 | 18 | NSData *GTLDecodeBase64(NSString *base64Str); 19 | NSString *GTLEncodeBase64(NSData *data); 20 | 21 | // "Web-safe" encoding substitutes - and _ for + and / in the encoding table, 22 | // per http://www.ietf.org/rfc/rfc4648.txt section 5. 23 | 24 | NSData *GTLDecodeWebSafeBase64(NSString *base64Str); 25 | NSString *GTLEncodeWebSafeBase64(NSData *data); 26 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLFramework.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | #ifndef _GTLFRAMEWORK_H_ 18 | #define _GTLFRAMEWORK_H_ 19 | 20 | #import 21 | 22 | #import "GTLDefines.h" 23 | 24 | 25 | // Returns the version of the framework. Major and minor should 26 | // match the bundle version in the Info.plist file. 27 | // 28 | // Pass NULL to ignore any of the parameters. 29 | 30 | void GTLFrameworkVersion(NSUInteger* major, NSUInteger* minor, NSUInteger* release); 31 | 32 | // Returns the version in @"a.b" or @"a.b.c" format 33 | NSString *GTLFrameworkVersionString(void); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GoogleOpenSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // GoogleOpenSource.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2013 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | 12 | // GTM. 13 | #import "GTMDefines.h" 14 | #import "GTMGarbageCollection.h" 15 | #import "GTMHTTPFetcher.h" 16 | #import "GTMHTTPFetcherLogging.h" 17 | #import "GTMHTTPFetcherService.h" 18 | #import "GTMHTTPFetchHistory.h" 19 | #import "GTMHTTPUploadFetcher.h" 20 | #import "GTMLogger.h" 21 | #import "GTMMethodCheck.h" 22 | #import "GTMNSDictionary+URLArguments.h" 23 | #import "GTMNSString+URLArguments.h" 24 | #import "GTMOAuth2Authentication.h" 25 | #import "GTMOAuth2SignIn.h" 26 | #import "GTMOAuth2ViewControllerTouch.h" 27 | #import "GTMObjC2Runtime.h" 28 | 29 | // Chrome. 30 | #import "OpenInChromeController.h" 31 | 32 | // GTL. 33 | #import "GTLBase64.h" 34 | #import "GTLBatchQuery.h" 35 | #import "GTLBatchResult.h" 36 | #import "GTLDateTime.h" 37 | #import "GTLDefines.h" 38 | #import "GTLErrorObject.h" 39 | #import "GTLFramework.h" 40 | #import "GTLJSONParser.h" 41 | #import "GTLObject.h" 42 | #import "GTLQuery.h" 43 | #import "GTLRuntimeCommon.h" 44 | #import "GTLService.h" 45 | #import "GTLUploadParameters.h" 46 | #import "GTLUtilities.h" 47 | 48 | // GTLPlus. 49 | #import "GTLPlus.h" 50 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLJSONParser.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLJSONParser.h 18 | // 19 | 20 | // This class is a thin wrapper around the JSON parser. It uses 21 | // NSJSONSerialization when available, and SBJSON otherwise. 22 | 23 | #import 24 | 25 | #import "GTLDefines.h" 26 | 27 | @interface GTLJSONParser : NSObject 28 | + (NSString*)stringWithObject:(id)value 29 | humanReadable:(BOOL)humanReadable 30 | error:(NSError**)error; 31 | 32 | + (NSData *)dataWithObject:(id)obj 33 | humanReadable:(BOOL)humanReadable 34 | error:(NSError**)error; 35 | 36 | + (id)objectWithString:(NSString *)jsonStr 37 | error:(NSError **)error; 38 | 39 | + (id)objectWithData:(NSData *)jsonData 40 | error:(NSError **)error; 41 | @end 42 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlus.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlus.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | 29 | #import "GTLPlusConstants.h" 30 | 31 | #import "GTLPlusAcl.h" 32 | #import "GTLPlusAclentryResource.h" 33 | #import "GTLPlusActivity.h" 34 | #import "GTLPlusActivityFeed.h" 35 | #import "GTLPlusComment.h" 36 | #import "GTLPlusCommentFeed.h" 37 | #import "GTLPlusItemScope.h" 38 | #import "GTLPlusMoment.h" 39 | #import "GTLPlusMomentsFeed.h" 40 | #import "GTLPlusPeopleFeed.h" 41 | #import "GTLPlusPerson.h" 42 | #import "GTLPlusPlace.h" 43 | 44 | #import "GTLQueryPlus.h" 45 | #import "GTLServicePlus.h" 46 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLErrorObject.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLErrorObject.h 18 | // 19 | 20 | #import "GTLObject.h" 21 | 22 | @class GTLErrorObjectData; 23 | 24 | @interface GTLErrorObject : GTLObject 25 | @property (retain) NSNumber *code; 26 | @property (retain) NSString *message; 27 | @property (retain) NSArray *data; // of GTLErrorObjectData 28 | 29 | // Convenience accessor for creating an NSError from a GTLErrorObject. 30 | @property (readonly) NSError *foundationError; 31 | 32 | // Convenience accessor for extracting the GTLErrorObject that was used to 33 | // create an NSError. 34 | // 35 | // Returns nil if the error was not originally from a GTLErrorObject. 36 | + (GTLErrorObject *)underlyingObjectForError:(NSError *)foundationError; 37 | 38 | @end 39 | 40 | @interface GTLErrorObjectData : GTLObject 41 | @property (retain) NSString *domain; 42 | @property (retain) NSString *reason; 43 | @property (retain) NSString *message; 44 | @property (retain) NSString *location; 45 | @end 46 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMNSDictionary+URLArguments.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMNSDictionary+URLArguments.h 3 | // 4 | // Copyright 2006-2008 Google Inc. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | // use this file except in compliance with the License. You may obtain a copy 8 | // of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | // License for the specific language governing permissions and limitations under 16 | // the License. 17 | // 18 | 19 | #import 20 | 21 | /// Utility for building a URL or POST argument string. 22 | @interface NSDictionary (GTMNSDictionaryURLArgumentsAdditions) 23 | 24 | /// Returns a dictionary of the decoded key-value pairs in a http arguments 25 | /// string of the form key1=value1&key2=value2&...&keyN=valueN. 26 | /// Keys and values will be unescaped automatically. 27 | /// Only the first value for a repeated key is returned. 28 | + (NSDictionary *)gtm_dictionaryWithHttpArgumentsString:(NSString *)argString; 29 | 30 | /// Gets a string representation of the dictionary in the form 31 | /// key1=value1&key2=value2&...&keyN=valueN, suitable for use as either 32 | /// URL arguments (after a '?') or POST body. Keys and values will be escaped 33 | /// automatically, so should be unescaped in the dictionary. 34 | - (NSString *)gtm_httpArgumentsString; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/Headers/GPPSignInButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPPSignInButton.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2012 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | #import 12 | 13 | // The various layout styles supported by the GPPSignInButton. 14 | // The minmum size of the button depends on the language used for text. 15 | // The following dimensions (in points) fit for all languages: 16 | // kGPPSignInButtonStyleStandard: 226 x 48 17 | // kGPPSignInButtonStyleWide: 308 x 48 18 | // kGPPSignInButtonStyleIconOnly: 46 x 48 (no text, fixed size) 19 | typedef enum { 20 | kGPPSignInButtonStyleStandard = 0, 21 | kGPPSignInButtonStyleWide = 1, 22 | kGPPSignInButtonStyleIconOnly = 2 23 | } GPPSignInButtonStyle; 24 | 25 | // The various color schemes supported by the GPPSignInButton. 26 | typedef enum { 27 | kGPPSignInButtonColorSchemeDark = 0, 28 | kGPPSignInButtonColorSchemeLight = 1 29 | } GPPSignInButtonColorScheme; 30 | 31 | // This class provides the Google+ sign-in button. You can instantiate this 32 | // class programmatically or from a NIB file. You should set up the 33 | // |GPPSignIn| shared instance with your client ID and any additional scopes, 34 | // implement the delegate methods for |GPPSignIn|, and add this button to your 35 | // view hierarchy. 36 | @interface GPPSignInButton : UIButton 37 | 38 | // The layout style for the sign-in button. The default style is standard. 39 | @property(nonatomic, assign) GPPSignInButtonStyle style; 40 | 41 | // The color scheme for the sign-in. The default scheme is dark. 42 | @property(nonatomic, assign) GPPSignInButtonColorScheme colorScheme; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMNSString+URLArguments.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMNSString+URLArguments.h 3 | // 4 | // Copyright 2006-2008 Google Inc. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | // use this file except in compliance with the License. You may obtain a copy 8 | // of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | // License for the specific language governing permissions and limitations under 16 | // the License. 17 | // 18 | 19 | #import 20 | 21 | /// Utilities for encoding and decoding URL arguments. 22 | @interface NSString (GTMNSStringURLArgumentsAdditions) 23 | 24 | /// Returns a string that is escaped properly to be a URL argument. 25 | // 26 | /// This differs from stringByAddingPercentEscapesUsingEncoding: in that it 27 | /// will escape all the reserved characters (per RFC 3986 28 | /// ) which 29 | /// stringByAddingPercentEscapesUsingEncoding would leave. 30 | /// 31 | /// This will also escape '%', so this should not be used on a string that has 32 | /// already been escaped unless double-escaping is the desired result. 33 | - (NSString*)gtm_stringByEscapingForURLArgument; 34 | 35 | /// Returns the unescaped version of a URL argument 36 | // 37 | /// This has the same behavior as stringByReplacingPercentEscapesUsingEncoding:, 38 | /// except that it will also convert '+' to space. 39 | - (NSString*)gtm_stringByUnescapingFromURLArgument; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchQuery.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLBatchQuery.h 18 | // 19 | 20 | // Batch query documentation: 21 | // https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Batch_Operations 22 | 23 | #import "GTLQuery.h" 24 | 25 | @interface GTLBatchQuery : NSObject { 26 | @private 27 | NSMutableArray *queries_; 28 | NSMutableDictionary *requestIDMap_; 29 | BOOL skipAuthorization_; 30 | NSDictionary *additionalHTTPHeaders_; 31 | NSDictionary *urlQueryParameters_; 32 | } 33 | 34 | // Queries included in this batch. Each query should have a unique requestID. 35 | @property (retain) NSArray *queries; 36 | 37 | // Clients may set this to YES to disallow authorization. Defaults to NO. 38 | @property (assign) BOOL shouldSkipAuthorization; 39 | 40 | // Any additional HTTP headers for this batch. 41 | // 42 | // These headers override the same keys from the service object's 43 | // additionalHTTPHeaders. 44 | @property (copy) NSDictionary *additionalHTTPHeaders; 45 | 46 | // Any URL query parameters to add to the query (useful for debugging with some 47 | // services). 48 | @property (copy) NSDictionary *urlQueryParameters; 49 | 50 | + (id)batchQuery; 51 | + (id)batchQueryWithQueries:(NSArray *)array; 52 | 53 | - (void)addQuery:(GTLQuery *)query GTL_NONNULL((1)); 54 | 55 | - (GTLQuery *)queryForRequestID:(NSString *)requestID GTL_NONNULL((1)); 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchResult.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLBatchResult.h 18 | // 19 | 20 | #import "GTLObject.h" 21 | 22 | @interface GTLBatchResult : GTLObject { 23 | @private 24 | NSMutableDictionary *successes_; 25 | NSMutableDictionary *failures_; 26 | } 27 | 28 | // Dictionaries of results for all queries in the batch 29 | // 30 | // Dictionary keys are requestID strings; objects are results or 31 | // GTLErrorObjects. 32 | // 33 | // For successes with no returned object (such as from delete operations), 34 | // the object for the dictionary entry is NSNull. 35 | // 36 | // 37 | // The original query for each result is available from the service ticket, 38 | // for example 39 | // 40 | // NSDictionary *successes = batchResults.successes; 41 | // for (NSString *requestID in successes) { 42 | // GTLObject *obj = [successes objectForKey:requestID]; 43 | // GTLQuery *query = [ticket queryForRequestID:requestID]; 44 | // NSLog(@"Query %@ returned object %@", query, obj); 45 | // } 46 | // 47 | // NSDictionary *failures = batchResults.failures; 48 | // for (NSString *requestID in failures) { 49 | // GTLErrorObject *errorObj = [failures objectForKey:requestID]; 50 | // GTLQuery *query = [ticket queryForRequestID:requestID]; 51 | // NSLog(@"Query %@ failed with error %@", query, errorObj); 52 | // } 53 | // 54 | 55 | @property (retain) NSMutableDictionary *successes; 56 | @property (retain) NSMutableDictionary *failures; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLRuntimeCommon.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLRuntimeCommon.h 18 | // 19 | 20 | 21 | #import 22 | 23 | #import "GTLDefines.h" 24 | 25 | // This protocol and support class are an internal implementation detail so 26 | // GTLObject and GTLQuery can share some code. 27 | 28 | @protocol GTLRuntimeCommon 29 | @required 30 | // Get/Set properties 31 | - (void)setJSONValue:(id)obj forKey:(NSString *)key; 32 | - (id)JSONValueForKey:(NSString *)key; 33 | // Child cache 34 | - (void)setCacheChild:(id)obj forKey:(NSString *)key; 35 | - (id)cacheChildForKey:(NSString *)key; 36 | // Surrogate class mappings. 37 | - (NSDictionary *)surrogates; 38 | // Key map 39 | + (NSDictionary *)propertyToJSONKeyMapForClass:(Class)aClass; 40 | // Array item types 41 | + (NSDictionary *)arrayPropertyToClassMapForClass:(Class)aClass; 42 | // The parent class for dynamic support 43 | + (Class)ancestorClass; 44 | @end 45 | 46 | @interface GTLRuntimeCommon : NSObject 47 | // Wire things up. 48 | + (BOOL)resolveInstanceMethod:(SEL)sel onClass:(Class)onClass; 49 | // Helpers 50 | + (id)objectFromJSON:(id)json 51 | defaultClass:(Class)defaultClass 52 | surrogates:(NSDictionary *)surrogates 53 | isCacheable:(BOOL*)isCacheable; 54 | + (id)jsonFromAPIObject:(id)obj 55 | expectedClass:(Class)expectedClass 56 | isCacheable:(BOOL*)isCacheable; 57 | @end 58 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAcl.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusAcl.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusAcl (0 custom class methods, 3 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusAclentryResource; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusAcl 42 | // 43 | 44 | // This class supports NSFastEnumeration over its "items" property. It also 45 | // supports -itemAtIndex: to retrieve individual objects from "items". 46 | 47 | @interface GTLPlusAcl : GTLCollectionObject 48 | 49 | // Description of the access granted, suitable for display. 50 | // Remapped to 'descriptionProperty' to avoid NSObject's 'description'. 51 | @property (copy) NSString *descriptionProperty; 52 | 53 | // The list of access entries. 54 | @property (retain) NSArray *items; // of GTLPlusAclentryResource 55 | 56 | // Identifies this resource as a collection of access controls. Value: 57 | // "plus#acl". 58 | @property (copy) NSString *kind; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLServicePlus.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLServicePlus.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLServicePlus (0 custom class methods, 0 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLService.h" 33 | #else 34 | #import "GTLService.h" 35 | #endif 36 | 37 | @interface GTLServicePlus : GTLService 38 | 39 | // No new methods 40 | 41 | // Clients should create a standard query with any of the class methods in 42 | // GTLQueryPlus.h. The query can the be sent with GTLService's execute methods, 43 | // 44 | // - (GTLServiceTicket *)executeQuery:(GTLQuery *)query 45 | // completionHandler:(void (^)(GTLServiceTicket *ticket, 46 | // id object, NSError *error))handler; 47 | // or 48 | // - (GTLServiceTicket *)executeQuery:(GTLQuery *)query 49 | // delegate:(id)delegate 50 | // didFinishSelector:(SEL)finishedSelector; 51 | // 52 | // where finishedSelector has a signature of: 53 | // 54 | // - (void)serviceTicket:(GTLServiceTicket *)ticket 55 | // finishedWithObject:(id)object 56 | // error:(NSError *)error; 57 | // 58 | // The object passed to the completion handler or delegate method 59 | // is a subclass of GTLObject, determined by the query method executed. 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMoment.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusMoment.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusMoment (0 custom class methods, 6 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusItemScope; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusMoment 42 | // 43 | 44 | @interface GTLPlusMoment : GTLObject 45 | 46 | // The moment ID. 47 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 48 | @property (copy) NSString *identifier; 49 | 50 | // Identifies this resource as a moment. 51 | @property (copy) NSString *kind; 52 | 53 | // The object generated by performing the action on the target. For example, a 54 | // user writes a review of a restaurant, the target is the restaurant and the 55 | // result is the review. 56 | @property (retain) GTLPlusItemScope *result; 57 | 58 | // Time stamp of when the action occurred in RFC3339 format. 59 | @property (retain) GTLDateTime *startDate; 60 | 61 | // The object on which the action was performed. 62 | @property (retain) GTLPlusItemScope *target; 63 | 64 | // The Google schema for the type of moment to write. For example, 65 | // http://schemas.google.com/AddActivity. 66 | @property (copy) NSString *type; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLDateTime.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLDateTime.h 18 | // 19 | // This is an immutable class representing a date and optionally a 20 | // time with time zone. 21 | // 22 | 23 | #import 24 | #import "GTLDefines.h" 25 | 26 | @interface GTLDateTime : NSObject { 27 | NSDateComponents *dateComponents_; 28 | NSInteger milliseconds_; // This is only for the fraction of a second 0-999 29 | NSInteger offsetSeconds_; // may be NSUndefinedDateComponent 30 | BOOL isUniversalTime_; // preserves "Z" 31 | NSTimeZone *timeZone_; // specific time zone by name, if known 32 | } 33 | 34 | + (GTLDateTime *)dateTimeWithRFC3339String:(NSString *)str; 35 | 36 | // timeZone may be nil if the time zone is not known. 37 | + (GTLDateTime *)dateTimeWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz; 38 | 39 | // Use this method to make a dateTime for an all-day event (date only, so 40 | // hasTime is NO.) 41 | + (GTLDateTime *)dateTimeForAllDayWithDate:(NSDate *)date; 42 | 43 | + (GTLDateTime *)dateTimeWithDateComponents:(NSDateComponents *)date; 44 | 45 | @property (nonatomic, readonly) NSDate *date; 46 | @property (nonatomic, readonly) NSCalendar *calendar; 47 | 48 | @property (nonatomic, readonly) NSString *RFC3339String; 49 | @property (nonatomic, readonly) NSString *stringValue; // same as RFC3339String 50 | 51 | @property (nonatomic, readonly, retain) NSTimeZone *timeZone; 52 | @property (nonatomic, readonly, copy) NSDateComponents *dateComponents; 53 | @property (nonatomic, readonly) NSInteger milliseconds; // This is only for the fraction of a second 0-999 54 | 55 | @property (nonatomic, readonly) BOOL hasTime; 56 | @property (nonatomic, readonly) NSInteger offsetSeconds; 57 | @property (nonatomic, readonly, getter=isUniversalTime) BOOL universalTime; 58 | 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAclentryResource.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusAclentryResource.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusAclentryResource (0 custom class methods, 3 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | // ---------------------------------------------------------------------------- 38 | // 39 | // GTLPlusAclentryResource 40 | // 41 | 42 | @interface GTLPlusAclentryResource : GTLObject 43 | 44 | // A descriptive name for this entry. Suitable for display. 45 | @property (copy) NSString *displayName; 46 | 47 | // The ID of the entry. For entries of type "person" or "circle", this is the ID 48 | // of the resource. For other types, this property is not set. 49 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 50 | @property (copy) NSString *identifier; 51 | 52 | // The type of entry describing to whom access is granted. Possible values are: 53 | // - "person" - Access to an individual. 54 | // - "circle" - Access to members of a circle. 55 | // - "myCircles" - Access to members of all the person's circles. 56 | // - "extendedCircles" - Access to members of all the person's circles, plus all 57 | // of the people in their circles. 58 | // - "domain" - Access to members of the person's Google Apps domain. 59 | // - "public" - Access to anyone on the web. 60 | @property (copy) NSString *type; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLUploadParameters.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLUploadParameters.h 18 | // 19 | 20 | // Uploading documentation: 21 | // https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Uploading_Files 22 | 23 | #import 24 | 25 | #import "GTLDefines.h" 26 | 27 | @interface GTLUploadParameters : NSObject { 28 | @private 29 | NSString *MIMEType_; 30 | NSData *data_; 31 | NSFileHandle *fileHandle_; 32 | NSURL *fileURL_; 33 | NSURL *uploadLocationURL_; 34 | NSString *slug_; 35 | BOOL shouldSendUploadOnly_; 36 | } 37 | 38 | // Uploading requires MIME type and one of 39 | // - data to be uploaded 40 | // - URL of file to be uploaded (preferred for large files) 41 | // - file handle for uploading 42 | @property (copy) NSString *MIMEType; 43 | @property (retain) NSData *data; 44 | @property (retain) NSFileHandle *fileHandle; 45 | @property (retain) NSURL *fileURL; 46 | 47 | // Resuming an in-progress upload is done with the upload location URL, 48 | // and requires a file handle for uploading 49 | @property (retain) NSURL *uploadLocationURL; 50 | 51 | // Some services need a slug (filename) header 52 | @property (copy) NSString *slug; 53 | 54 | // Uploads may be done without a JSON body in the initial request 55 | @property (assign) BOOL shouldSendUploadOnly; 56 | 57 | + (instancetype)uploadParametersWithData:(NSData *)data 58 | MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); 59 | 60 | + (instancetype)uploadParametersWithFileHandle:(NSFileHandle *)fileHandle 61 | MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); 62 | 63 | + (instancetype)uploadParametersWithFileURL:(NSURL *)fileHandle 64 | MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/Headers/GPPDeepLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPPDeepLink.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2012 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | #import 12 | 13 | @class GPPDeepLink; 14 | 15 | // A protocol optionally implemented by the client of |GPPDeepLink|. 16 | @protocol GPPDeepLinkDelegate 17 | 18 | // Notifies the client that a deep link has been received either from 19 | // |readDeepLinkAfterInstall| or |handleURL:sourceApplication:annotation:|. 20 | - (void)didReceiveDeepLink:(GPPDeepLink *)deepLink; 21 | 22 | @end 23 | 24 | // This class handles a deep link within a share posted on Google+. 25 | // For more information on deep links, see 26 | // http://developers.google.com/+/mobile/ios/share . 27 | @interface GPPDeepLink : NSObject 28 | 29 | // Sets the delegate to handle the deep link. 30 | + (void)setDelegate:(id)delegate; 31 | 32 | // Returns a |GPPDeepLink| for your app to handle, or |nil| if not found. The 33 | // deep-link ID can be obtained from |GPPDeepLink|. It is stored when a user 34 | // clicks a link to your app from a Google+ post, but hasn't yet installed your 35 | // app. The user will be redirected to the App Store to install your app. This 36 | // method should be called on or near your app launch to take the user to 37 | // deep-link ID within your app. The delegate will be called if set and if a 38 | // deep link is found. 39 | + (GPPDeepLink *)readDeepLinkAfterInstall; 40 | 41 | // This method should be called from your |UIApplicationDelegate|'s 42 | // |application:openURL:sourceApplication:annotation|. Returns 43 | // |GooglePlusDeepLink| if |GooglePlusDeepLink| handled this URL, |nil| 44 | // otherwise. The delegate will be called if set and if a deep link is found. 45 | // Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|. 46 | + (GPPDeepLink *)handleURL:(NSURL *)url 47 | sourceApplication:(NSString *)sourceApplication 48 | annotation:(id)annotation; 49 | 50 | // The deep-link ID in |GPPDeepLink| that was passed to the app. 51 | - (NSString *)deepLinkID; 52 | 53 | // This instance method indicates where the user came from before arriving in 54 | // your app. This method is provided for you to collect engagement metrics. 55 | // For the possible values, see 56 | // http://developers.google.com/+/mobile/ios/source-values . 57 | - (NSString *)source; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMomentsFeed.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusMomentsFeed.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusMomentsFeed (0 custom class methods, 8 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusMoment; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusMomentsFeed 42 | // 43 | 44 | // This class supports NSFastEnumeration over its "items" property. It also 45 | // supports -itemAtIndex: to retrieve individual objects from "items". 46 | 47 | @interface GTLPlusMomentsFeed : GTLCollectionObject 48 | 49 | // ETag of this response for caching purposes. 50 | @property (copy) NSString *ETag; 51 | 52 | // The moments in this page of results. 53 | @property (retain) NSArray *items; // of GTLPlusMoment 54 | 55 | // Identifies this resource as a collection of moments. Value: 56 | // "plus#momentsFeed". 57 | @property (copy) NSString *kind; 58 | 59 | // Link to the next page of moments. 60 | @property (copy) NSString *nextLink; 61 | 62 | // The continuation token, which is used to page through large result sets. 63 | // Provide this value in a subsequent request to return the next page of 64 | // results. 65 | @property (copy) NSString *nextPageToken; 66 | 67 | // Link to this page of moments. 68 | @property (copy) NSString *selfLink; 69 | 70 | // The title of this collection of moments. 71 | @property (copy) NSString *title; 72 | 73 | // The RFC 339 timestamp for when this collection of moments was last updated. 74 | @property (retain) GTLDateTime *updated; 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusCommentFeed.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusCommentFeed.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusCommentFeed (0 custom class methods, 8 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusComment; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusCommentFeed 42 | // 43 | 44 | // This class supports NSFastEnumeration over its "items" property. It also 45 | // supports -itemAtIndex: to retrieve individual objects from "items". 46 | 47 | @interface GTLPlusCommentFeed : GTLCollectionObject 48 | 49 | // ETag of this response for caching purposes. 50 | @property (copy) NSString *ETag; 51 | 52 | // The ID of this collection of comments. 53 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 54 | @property (copy) NSString *identifier; 55 | 56 | // The comments in this page of results. 57 | @property (retain) NSArray *items; // of GTLPlusComment 58 | 59 | // Identifies this resource as a collection of comments. Value: 60 | // "plus#commentFeed". 61 | @property (copy) NSString *kind; 62 | 63 | // Link to the next page of activities. 64 | @property (copy) NSString *nextLink; 65 | 66 | // The continuation token, which is used to page through large result sets. 67 | // Provide this value in a subsequent request to return the next page of 68 | // results. 69 | @property (copy) NSString *nextPageToken; 70 | 71 | // The title of this collection of comments. 72 | @property (copy) NSString *title; 73 | 74 | // The time at which this collection of comments was last updated. Formatted as 75 | // an RFC 3339 timestamp. 76 | @property (retain) GTLDateTime *updated; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPlace.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusPlace.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusPlace (0 custom class methods, 4 custom properties) 30 | // GTLPlusPlaceAddress (0 custom class methods, 1 custom properties) 31 | // GTLPlusPlacePosition (0 custom class methods, 2 custom properties) 32 | 33 | #if GTL_BUILT_AS_FRAMEWORK 34 | #import "GTL/GTLObject.h" 35 | #else 36 | #import "GTLObject.h" 37 | #endif 38 | 39 | @class GTLPlusPlaceAddress; 40 | @class GTLPlusPlacePosition; 41 | 42 | // ---------------------------------------------------------------------------- 43 | // 44 | // GTLPlusPlace 45 | // 46 | 47 | @interface GTLPlusPlace : GTLObject 48 | 49 | // The physical address of the place. 50 | @property (retain) GTLPlusPlaceAddress *address; 51 | 52 | // The display name of the place. 53 | @property (copy) NSString *displayName; 54 | 55 | // Identifies this resource as a place. Value: "plus#place". 56 | @property (copy) NSString *kind; 57 | 58 | // The position of the place. 59 | @property (retain) GTLPlusPlacePosition *position; 60 | 61 | @end 62 | 63 | 64 | // ---------------------------------------------------------------------------- 65 | // 66 | // GTLPlusPlaceAddress 67 | // 68 | 69 | @interface GTLPlusPlaceAddress : GTLObject 70 | 71 | // The formatted address for display. 72 | @property (copy) NSString *formatted; 73 | 74 | @end 75 | 76 | 77 | // ---------------------------------------------------------------------------- 78 | // 79 | // GTLPlusPlacePosition 80 | // 81 | 82 | @interface GTLPlusPlacePosition : GTLObject 83 | 84 | // The latitude of this position. 85 | @property (retain) NSNumber *latitude; // doubleValue 86 | 87 | // The longitude of this position. 88 | @property (retain) NSNumber *longitude; // doubleValue 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPeopleFeed.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusPeopleFeed.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusPeopleFeed (0 custom class methods, 7 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusPerson; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusPeopleFeed 42 | // 43 | 44 | // This class supports NSFastEnumeration over its "items" property. It also 45 | // supports -itemAtIndex: to retrieve individual objects from "items". 46 | 47 | @interface GTLPlusPeopleFeed : GTLCollectionObject 48 | 49 | // ETag of this response for caching purposes. 50 | @property (copy) NSString *ETag; 51 | 52 | // The people in this page of results. Each item includes the id, displayName, 53 | // image, and url for the person. To retrieve additional profile data, see the 54 | // people.get method. 55 | @property (retain) NSArray *items; // of GTLPlusPerson 56 | 57 | // Identifies this resource as a collection of people. Value: "plus#peopleFeed". 58 | @property (copy) NSString *kind; 59 | 60 | // The continuation token, which is used to page through large result sets. 61 | // Provide this value in a subsequent request to return the next page of 62 | // results. 63 | @property (copy) NSString *nextPageToken; 64 | 65 | // Link to this resource. 66 | @property (copy) NSString *selfLink; 67 | 68 | // The title of this collection of people. 69 | @property (copy) NSString *title; 70 | 71 | // The total number of people available in this list. The number of people in a 72 | // response might be smaller due to paging. This might not be set for all 73 | // collections. 74 | @property (retain) NSNumber *totalItems; // intValue 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusConstants.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusConstants.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | 29 | #import 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLDefines.h" 33 | #else 34 | #import "GTLDefines.h" 35 | #endif 36 | 37 | // Authorization scope 38 | // Know your basic profile info and list of people in your circles. 39 | GTL_EXTERN NSString * const kGTLAuthScopePlusLogin; // "https://www.googleapis.com/auth/plus.login" 40 | // Know who you are on Google 41 | GTL_EXTERN NSString * const kGTLAuthScopePlusMe; // "https://www.googleapis.com/auth/plus.me" 42 | // View your email address 43 | GTL_EXTERN NSString * const kGTLAuthScopePlusUserinfoEmail; // "https://www.googleapis.com/auth/userinfo.email" 44 | // View basic information about your account 45 | GTL_EXTERN NSString * const kGTLAuthScopePlusUserinfoProfile; // "https://www.googleapis.com/auth/userinfo.profile" 46 | 47 | // Collection 48 | GTL_EXTERN NSString * const kGTLPlusCollectionConnected; // "connected" 49 | GTL_EXTERN NSString * const kGTLPlusCollectionPlusoners; // "plusoners" 50 | GTL_EXTERN NSString * const kGTLPlusCollectionPublic; // "public" 51 | GTL_EXTERN NSString * const kGTLPlusCollectionResharers; // "resharers" 52 | GTL_EXTERN NSString * const kGTLPlusCollectionVault; // "vault" 53 | GTL_EXTERN NSString * const kGTLPlusCollectionVisible; // "visible" 54 | 55 | // OrderBy 56 | GTL_EXTERN NSString * const kGTLPlusOrderByAlphabetical; // "alphabetical" 57 | GTL_EXTERN NSString * const kGTLPlusOrderByBest; // "best" 58 | GTL_EXTERN NSString * const kGTLPlusOrderByRecent; // "recent" 59 | 60 | // SortOrder 61 | GTL_EXTERN NSString * const kGTLPlusSortOrderAscending; // "ascending" 62 | GTL_EXTERN NSString * const kGTLPlusSortOrderDescending; // "descending" 63 | -------------------------------------------------------------------------------- /plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Google+ 8 | 9 | 10 | Use your Google account to authenticate with the app. 11 | 12 | 13 | MIT 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | CFBundleTypeRole 62 | Editor 63 | CFBundleURLName 64 | $PACKAGE_NAME 65 | CFBundleURLSchemes 66 | 67 | $PACKAGE_NAME 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivityFeed.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusActivityFeed.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusActivityFeed (0 custom class methods, 9 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusActivity; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusActivityFeed 42 | // 43 | 44 | // This class supports NSFastEnumeration over its "items" property. It also 45 | // supports -itemAtIndex: to retrieve individual objects from "items". 46 | 47 | @interface GTLPlusActivityFeed : GTLCollectionObject 48 | 49 | // ETag of this response for caching purposes. 50 | @property (copy) NSString *ETag; 51 | 52 | // The ID of this collection of activities. Deprecated. 53 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 54 | @property (copy) NSString *identifier; 55 | 56 | // The activities in this page of results. 57 | @property (retain) NSArray *items; // of GTLPlusActivity 58 | 59 | // Identifies this resource as a collection of activities. Value: 60 | // "plus#activityFeed". 61 | @property (copy) NSString *kind; 62 | 63 | // Link to the next page of activities. 64 | @property (copy) NSString *nextLink; 65 | 66 | // The continuation token, which is used to page through large result sets. 67 | // Provide this value in a subsequent request to return the next page of 68 | // results. 69 | @property (copy) NSString *nextPageToken; 70 | 71 | // Link to this activity resource. 72 | @property (copy) NSString *selfLink; 73 | 74 | // The title of this collection of activities, which is a truncated portion of 75 | // the content. 76 | @property (copy) NSString *title; 77 | 78 | // The time at which this collection of activities was last updated. Formatted 79 | // as an RFC 3339 timestamp. 80 | @property (retain) GTLDateTime *updated; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLTargetNamespace.h: -------------------------------------------------------------------------------- 1 | // 2 | // Makes the value of GTL_TARGET_NAMESPACE a prefix for all GTL 3 | // library class names 4 | // 5 | 6 | // 7 | // To avoid global namespace issues, define GTL_TARGET_NAMESPACE to a short 8 | // string in your target if you are using the GTL library in a shared-code 9 | // environment like a plug-in. 10 | // 11 | // For example: -DGTL_TARGET_NAMESPACE=MyPlugin 12 | // 13 | 14 | // 15 | // com.google.GTLFramework v. 2.0 (29 classes) 2011-10-25 19:25:36 -0700 16 | // 17 | 18 | #if defined(__OBJC__) && defined(GTL_TARGET_NAMESPACE) 19 | 20 | #define _GTL_NS_SYMBOL_INNER(ns, symbol) ns ## _ ## symbol 21 | #define _GTL_NS_SYMBOL_MIDDLE(ns, symbol) _GTL_NS_SYMBOL_INNER(ns, symbol) 22 | #define _GTL_NS_SYMBOL(symbol) _GTL_NS_SYMBOL_MIDDLE(GTL_TARGET_NAMESPACE, symbol) 23 | 24 | #define _GTL_NS_STRING_INNER(ns) #ns 25 | #define _GTL_NS_STRING_MIDDLE(ns) _GTL_NS_STRING_INNER(ns) 26 | #define GTL_TARGET_NAMESPACE_STRING _GTL_NS_STRING_MIDDLE(GTL_TARGET_NAMESPACE) 27 | 28 | #define GTLBatchQuery _GTL_NS_SYMBOL(GTLBatchQuery) 29 | #define GTLBatchResult _GTL_NS_SYMBOL(GTLBatchResult) 30 | #define GTLCollectionObject _GTL_NS_SYMBOL(GTLCollectionObject) 31 | #define GTLDateTime _GTL_NS_SYMBOL(GTLDateTime) 32 | #define GTLErrorObject _GTL_NS_SYMBOL(GTLErrorObject) 33 | #define GTLErrorObjectData _GTL_NS_SYMBOL(GTLErrorObjectData) 34 | #define GTLJSONParser _GTL_NS_SYMBOL(GTLJSONParser) 35 | #define GTLObject _GTL_NS_SYMBOL(GTLObject) 36 | #define GTLQuery _GTL_NS_SYMBOL(GTLQuery) 37 | #define GTLRuntimeCommon _GTL_NS_SYMBOL(GTLRuntimeCommon) 38 | #define GTLService _GTL_NS_SYMBOL(GTLService) 39 | #define GTLServiceTicket _GTL_NS_SYMBOL(GTLServiceTicket) 40 | #define GTLUploadParameters _GTL_NS_SYMBOL(GTLUploadParameters) 41 | #define GTLUtilities _GTL_NS_SYMBOL(GTLUtilities) 42 | #define GTMCachedURLResponse _GTL_NS_SYMBOL(GTMCachedURLResponse) 43 | #define GTMCookieStorage _GTL_NS_SYMBOL(GTMCookieStorage) 44 | #define GTMGatherInputStream _GTL_NS_SYMBOL(GTMGatherInputStream) 45 | #define GTMHTTPFetcher _GTL_NS_SYMBOL(GTMHTTPFetcher) 46 | #define GTMHTTPFetcherService _GTL_NS_SYMBOL(GTMHTTPFetcherService) 47 | #define GTMHTTPFetchHistory _GTL_NS_SYMBOL(GTMHTTPFetchHistory) 48 | #define GTMHTTPUploadFetcher _GTL_NS_SYMBOL(GTMHTTPUploadFetcher) 49 | #define GTMMIMEDocument _GTL_NS_SYMBOL(GTMMIMEDocument) 50 | #define GTMMIMEPart _GTL_NS_SYMBOL(GTMMIMEPart) 51 | #define GTMOAuth2Authentication _GTL_NS_SYMBOL(GTMOAuth2Authentication) 52 | #define GTMOAuth2AuthorizationArgs _GTL_NS_SYMBOL(GTMOAuth2AuthorizationArgs) 53 | #define GTMOAuth2SignIn _GTL_NS_SYMBOL(GTMOAuth2SignIn) 54 | #define GTMOAuth2WindowController _GTL_NS_SYMBOL(GTMOAuth2WindowController) 55 | #define GTMReadMonitorInputStream _GTL_NS_SYMBOL(GTMReadMonitorInputStream) 56 | #define GTMURLCache _GTL_NS_SYMBOL(GTMURLCache) 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/OpenInChromeController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #import 31 | 32 | // Values for the open in chrome user preference. 33 | typedef enum { 34 | kOpenInChromeNone, // The value is not set. 35 | kOpenInChromeAsk, // Ask which browser to use every time. 36 | kOpenInChromeAlways, // Always use Chrome to open links. 37 | } OpenInChromePreference; 38 | 39 | // This class is used to check if Google Chrome is installed in the system and 40 | // to open a URL in Google Chrome either with or without a callback URL. 41 | @interface OpenInChromeController : NSObject 42 | 43 | // Returns a shared instance of the OpenInChromeController. 44 | + (OpenInChromeController *)sharedInstance; 45 | 46 | // Returns YES if Google Chrome is installed in the user's system. 47 | - (BOOL)isChromeInstalled; 48 | 49 | // Opens a URL in Google Chrome. 50 | - (BOOL)openInChrome:(NSURL *)url; 51 | 52 | // Open a URL in Google Chrome providing a |callbackURL| to return to the app. 53 | // URLs from the same app will be opened in the same tab unless |createNewTab| 54 | // is set to YES. 55 | // |callbackURL| can be nil. 56 | // The return value of this method is YES if the URL is successfully opened. 57 | - (BOOL)openInChrome:(NSURL *)url 58 | withCallbackURL:(NSURL *)callbackURL 59 | createNewTab:(BOOL)createNewTab; 60 | 61 | // Returns the user preference regarding whether or not to always open links 62 | // in Google Chrome. 63 | - (OpenInChromePreference)openInChromePreference; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Hello World 10 | 11 | 12 |
13 | 14 | 15 |

Google+

16 | 17 | 31 |
32 | 33 | 34 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLUtilities.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #import 17 | 18 | #ifndef SKIP_GTL_DEFINES 19 | #import "GTLDefines.h" 20 | #endif 21 | 22 | // helper functions for implementing isEqual: 23 | BOOL GTL_AreEqualOrBothNil(id obj1, id obj2); 24 | BOOL GTL_AreBoolsEqual(BOOL b1, BOOL b2); 25 | 26 | // Helper to ensure a number is a number. 27 | // 28 | // The GoogleAPI servers will send numbers >53 bits as strings to avoid 29 | // bugs in some JavaScript implementations. Work around this by catching 30 | // the string and turning it back into a number. 31 | NSNumber *GTL_EnsureNSNumber(NSNumber *num); 32 | 33 | @interface GTLUtilities : NSObject 34 | 35 | // 36 | // String encoding 37 | // 38 | 39 | // URL encoding, different for parts of URLs and parts of URL parameters 40 | // 41 | // +stringByURLEncodingString just makes a string legal for a URL 42 | // 43 | // +stringByURLEncodingForURI also encodes some characters that are legal in 44 | // URLs but should not be used in URIs, 45 | // per http://bitworking.org/projects/atom/rfc5023.html#rfc.section.9.7 46 | // 47 | // +stringByURLEncodingStringParameter is like +stringByURLEncodingForURI but 48 | // replaces space characters with + characters rather than percent-escaping them 49 | // 50 | + (NSString *)stringByURLEncodingString:(NSString *)str; 51 | + (NSString *)stringByURLEncodingForURI:(NSString *)str; 52 | + (NSString *)stringByURLEncodingStringParameter:(NSString *)str; 53 | 54 | // Percent-encoded UTF-8 55 | + (NSString *)stringByPercentEncodingUTF8ForString:(NSString *)str; 56 | 57 | // Key-value coding searches in an array 58 | // 59 | // Utilities to get from an array objects having a known value (or nil) 60 | // at a keyPath 61 | 62 | + (NSArray *)objectsFromArray:(NSArray *)sourceArray 63 | withValue:(id)desiredValue 64 | forKeyPath:(NSString *)keyPath; 65 | 66 | + (id)firstObjectFromArray:(NSArray *)sourceArray 67 | withValue:(id)desiredValue 68 | forKeyPath:(NSString *)keyPath; 69 | 70 | // 71 | // Version helpers 72 | // 73 | 74 | + (NSComparisonResult)compareVersion:(NSString *)ver1 toVersion:(NSString *)ver2; 75 | 76 | // 77 | // URL builder 78 | // 79 | 80 | // If there are already query parameters on urlString, the new ones are simple 81 | // appended after them. 82 | + (NSURL *)URLWithString:(NSString *)urlString 83 | queryParameters:(NSDictionary *)queryParameters; 84 | 85 | // Allocate a global dictionary 86 | + (NSMutableDictionary *)newStaticDictionary; 87 | 88 | // Walk up the class tree merging dictionaries and return the result. 89 | + (NSDictionary *)mergedClassDictionaryForSelector:(SEL)selector 90 | startClass:(Class)startClass 91 | ancestorClass:(Class)ancestorClass 92 | cache:(NSMutableDictionary *)cache; 93 | @end 94 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMMethodCheck.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMMethodCheck.h 3 | // 4 | // Copyright 2006-2008 Google Inc. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | // use this file except in compliance with the License. You may obtain a copy 8 | // of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | // License for the specific language governing permissions and limitations under 16 | // the License. 17 | // 18 | 19 | #import 20 | #import 21 | #import 22 | 23 | /// A macro for enforcing debug time checks to make sure all required methods are linked in 24 | // 25 | // When using categories, it can be very easy to forget to include the 26 | // implementation of a category. 27 | // Let's say you had a class foo that depended on method bar of class baz, and 28 | // method bar was implemented as a member of a category. 29 | // You could add the following code: 30 | // @implementation foo 31 | // GTM_METHOD_CHECK(baz, bar) 32 | // @end 33 | // and the code would check to make sure baz was implemented just before main 34 | // was called. This works for both dynamic libraries, and executables. 35 | // 36 | // Classes (or one of their superclasses) being checked must conform to the 37 | // NSObject protocol. We will check this, and spit out a warning if a class does 38 | // not conform to NSObject. 39 | // 40 | // This is not compiled into release builds. 41 | 42 | #ifdef DEBUG 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | // If you get an error for GTMMethodCheckMethodChecker not being defined, 49 | // you need to link in GTMMethodCheck.m. We keep it hidden so that we can have 50 | // it living in several separate images without conflict. 51 | // Functions with the ((constructor)) attribute are called after all +loads 52 | // have been called. See "Initializing Objective-C Classes" in 53 | // http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-DontLinkElementID_20 54 | 55 | __attribute__ ((constructor, visibility("hidden"))) void GTMMethodCheckMethodChecker(void); 56 | 57 | #ifdef __cplusplus 58 | }; 59 | #endif 60 | 61 | // This is the "magic". 62 | // A) we need a multi layer define here so that the stupid preprocessor 63 | // expands __LINE__ out the way we want it. We need LINE so that each of 64 | // out GTM_METHOD_CHECKs generates a unique class method for the class. 65 | #define GTM_METHOD_CHECK(class, method) GTM_METHOD_CHECK_INNER(class, method, __LINE__) 66 | #define GTM_METHOD_CHECK_INNER(class, method, line) GTM_METHOD_CHECK_INNER_INNER(class, method, line) 67 | 68 | // B) Create up a class method called xxGMethodCheckMethod+class+line that the 69 | // GTMMethodCheckMethodChecker function can look for and call. We 70 | // look for GTMMethodCheckMethodChecker to enforce linkage of 71 | // GTMMethodCheck.m. 72 | #define GTM_METHOD_CHECK_INNER_INNER(class, method, line) \ 73 | + (void)xxGTMMethodCheckMethod ## class ## line { \ 74 | void (*addr)() = GTMMethodCheckMethodChecker; \ 75 | if (addr && ![class instancesRespondToSelector:@selector(method)] \ 76 | && ![class respondsToSelector:@selector(method)]) { \ 77 | fprintf(stderr, "%s:%d: error: We need method '%s' to be linked in for class '%s'\n", \ 78 | __FILE__, line, #method, #class); \ 79 | exit(EX_SOFTWARE); \ 80 | } \ 81 | } 82 | 83 | #else // !DEBUG 84 | 85 | // Do nothing in release. 86 | #define GTM_METHOD_CHECK(class, method) 87 | 88 | #endif // DEBUG 89 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcherLogging.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #import "GTMHTTPFetcher.h" 17 | 18 | // GTM HTTP Logging 19 | // 20 | // All traffic using GTMHTTPFetcher can be easily logged. Call 21 | // 22 | // [GTMHTTPFetcher setLoggingEnabled:YES]; 23 | // 24 | // to begin generating log files. 25 | // 26 | // Log files are put into a folder on the desktop called "GTMHTTPDebugLogs" 27 | // unless another directory is specified with +setLoggingDirectory. 28 | // 29 | // In the iPhone simulator, the default logs location is the user's home 30 | // directory in ~/Library/Application Support. On the iPhone device, the 31 | // default logs location is the application's documents directory on the device. 32 | // 33 | // Tip: use the Finder's "Sort By Date" to find the most recent logs. 34 | // 35 | // Each run of an application gets a separate set of log files. An html 36 | // file is generated to simplify browsing the run's http transactions. 37 | // The html file includes javascript links for inline viewing of uploaded 38 | // and downloaded data. 39 | // 40 | // A symlink is created in the logs folder to simplify finding the html file 41 | // for the latest run of the application; the symlink is called 42 | // 43 | // AppName_http_log_newest.html 44 | // 45 | // For better viewing of XML logs, use Camino or Firefox rather than Safari. 46 | // 47 | // Each fetcher may be given a comment to be inserted as a label in the logs, 48 | // such as 49 | // [fetcher setCommentWithFormat:@"retrieve item %@", itemName]; 50 | // 51 | // Projects may define STRIP_GTM_FETCH_LOGGING to remove logging code. 52 | 53 | #if !STRIP_GTM_FETCH_LOGGING 54 | 55 | @interface GTMHTTPFetcher (GTMHTTPFetcherLogging) 56 | 57 | // Note: the default logs directory is ~/Desktop/GTMHTTPDebugLogs; it will be 58 | // created as needed. If a custom directory is set, the directory should 59 | // already exist. 60 | + (void)setLoggingDirectory:(NSString *)path; 61 | + (NSString *)loggingDirectory; 62 | 63 | // client apps can turn logging on and off 64 | + (void)setLoggingEnabled:(BOOL)flag; 65 | + (BOOL)isLoggingEnabled; 66 | 67 | // client apps can turn off logging to a file if they want to only check 68 | // the fetcher's log property 69 | + (void)setLoggingToFileEnabled:(BOOL)flag; 70 | + (BOOL)isLoggingToFileEnabled; 71 | 72 | // client apps can optionally specify process name and date string used in 73 | // log file names 74 | + (void)setLoggingProcessName:(NSString *)str; 75 | + (NSString *)loggingProcessName; 76 | 77 | + (void)setLoggingDateStamp:(NSString *)str; 78 | + (NSString *)loggingDateStamp; 79 | 80 | // internal; called by fetcher 81 | - (void)logFetchWithError:(NSError *)error; 82 | - (BOOL)logCapturePostStream; 83 | 84 | // internal; accessors useful for viewing logs 85 | + (NSString *)processNameLogPrefix; 86 | + (NSString *)symlinkNameSuffix; 87 | + (NSString *)htmlFileName; 88 | 89 | // Applications may provide alternative body strings to be displayed in the 90 | // log, such as for binary requests or responses. If deferring is turned 91 | // on, the response log will not be sent until deferring is turned off, 92 | // allowing the application to write the response body after the response 93 | // data has been parsed. 94 | - (void)setLogRequestBody:(NSString *)bodyString; 95 | - (NSString *)logRequestBody; 96 | - (void)setLogResponseBody:(NSString *)bodyString; 97 | - (NSString *)logResponseBody; 98 | - (void)setShouldDeferResponseBodyLogging:(BOOL)flag; 99 | - (BOOL)shouldDeferResponseBodyLogging; 100 | 101 | @end 102 | 103 | #endif // !STRIP_GTM_FETCH_LOGGING 104 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLDefines.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLDefines.h 18 | // 19 | 20 | // Ensure Apple's conditionals we depend on are defined. 21 | #import 22 | #import 23 | 24 | // 25 | // The developer may choose to define these in the project: 26 | // 27 | // #define GTL_TARGET_NAMESPACE Xxx // preface all GTL class names with Xxx (recommended for building plug-ins) 28 | // #define GTL_FOUNDATION_ONLY 1 // builds without AppKit or Carbon (default for iPhone builds) 29 | // #define STRIP_GTM_FETCH_LOGGING 1 // omit http logging code (default for iPhone release builds) 30 | // 31 | // Mac developers may find GTL_SIMPLE_DESCRIPTIONS and STRIP_GTM_FETCH_LOGGING useful for 32 | // reducing code size. 33 | // 34 | 35 | // Define later OS versions when building on earlier versions 36 | #ifdef MAC_OS_X_VERSION_10_0 37 | #ifndef MAC_OS_X_VERSION_10_6 38 | #define MAC_OS_X_VERSION_10_6 1060 39 | #endif 40 | #endif 41 | 42 | 43 | #ifdef GTL_TARGET_NAMESPACE 44 | // prefix all GTL class names with GTL_TARGET_NAMESPACE for this target 45 | #import "GTLTargetNamespace.h" 46 | #endif 47 | 48 | // Provide a common definition for externing constants/functions 49 | #if defined(__cplusplus) 50 | #define GTL_EXTERN extern "C" 51 | #else 52 | #define GTL_EXTERN extern 53 | #endif 54 | 55 | #if TARGET_OS_IPHONE // iPhone SDK 56 | 57 | #define GTL_IPHONE 1 58 | 59 | #endif 60 | 61 | #if GTL_IPHONE 62 | 63 | #define GTL_FOUNDATION_ONLY 1 64 | 65 | #endif 66 | 67 | // 68 | // GTL_ASSERT is like NSAssert, but takes a variable number of arguments: 69 | // 70 | // GTL_ASSERT(condition, @"Problem in argument %@", argStr); 71 | // 72 | // GTL_DEBUG_ASSERT is similar, but compiles in only for debug builds 73 | // 74 | 75 | #ifndef GTL_ASSERT 76 | // we directly invoke the NSAssert handler so we can pass on the varargs 77 | #if !defined(NS_BLOCK_ASSERTIONS) 78 | #define GTL_ASSERT(condition, ...) \ 79 | do { \ 80 | if (!(condition)) { \ 81 | [[NSAssertionHandler currentHandler] \ 82 | handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ 83 | file:[NSString stringWithUTF8String:__FILE__] \ 84 | lineNumber:__LINE__ \ 85 | description:__VA_ARGS__]; \ 86 | } \ 87 | } while(0) 88 | #else 89 | #define GTL_ASSERT(condition, ...) do { } while (0) 90 | #endif // !defined(NS_BLOCK_ASSERTIONS) 91 | #endif // GTL_ASSERT 92 | 93 | #ifndef GTL_DEBUG_ASSERT 94 | #if DEBUG 95 | #define GTL_DEBUG_ASSERT(condition, ...) GTL_ASSERT(condition, __VA_ARGS__) 96 | #else 97 | #define GTL_DEBUG_ASSERT(condition, ...) do { } while (0) 98 | #endif 99 | #endif 100 | 101 | #ifndef GTL_DEBUG_LOG 102 | #if DEBUG 103 | #define GTL_DEBUG_LOG(...) NSLog(__VA_ARGS__) 104 | #else 105 | #define GTL_DEBUG_LOG(...) do { } while (0) 106 | #endif 107 | #endif 108 | 109 | #ifndef STRIP_GTM_FETCH_LOGGING 110 | #if GTL_IPHONE && !DEBUG 111 | #define STRIP_GTM_FETCH_LOGGING 1 112 | #else 113 | #define STRIP_GTM_FETCH_LOGGING 0 114 | #endif 115 | #endif 116 | 117 | // Some support for advanced clang static analysis functionality 118 | // See http://clang-analyzer.llvm.org/annotations.html 119 | #ifndef __has_feature // Optional. 120 | #define __has_feature(x) 0 // Compatibility with non-clang compilers. 121 | #endif 122 | #ifndef NS_RETURNS_NOT_RETAINED 123 | #if __has_feature(attribute_ns_returns_not_retained) 124 | #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) 125 | #else 126 | #define NS_RETURNS_NOT_RETAINED 127 | #endif 128 | #endif 129 | 130 | #ifndef __has_attribute 131 | #define __has_attribute(x) 0 132 | #endif 133 | 134 | #if 1 135 | // We will start using nonnull declarations once the static analyzer seems 136 | // to support it without false positives. 137 | #define GTL_NONNULL(x) 138 | #else 139 | #if __has_attribute(nonnull) 140 | #define GTL_NONNULL(x) __attribute__((nonnull x)) 141 | #else 142 | #define GTL_NONNULL(x) 143 | #endif 144 | #endif 145 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcherService.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTMHTTPFetcherService.h 18 | // 19 | 20 | // The fetcher service class maintains a history to be used by a sequence 21 | // of fetchers objects generated by the service. 22 | // 23 | // Fetchers that do not need to share a history may be generated independently, 24 | // like 25 | // 26 | // GTMHTTPFetcher* myFetcher = [GTMHTTPFetcher fetcherWithRequest:request]; 27 | // 28 | // Fetchers that should share cookies or an ETagged data cache should be 29 | // generated by a common GTMHTTPFetcherService instance, like 30 | // 31 | // GTMHTTPFetcherService *myFetcherService = [[GTMHTTPFetcherService alloc] init]; 32 | // GTMHTTPFetcher* myFirstFetcher = [myFetcherService fetcherWithRequest:request1]; 33 | // GTMHTTPFetcher* mySecondFetcher = [myFetcherService fetcherWithRequest:request2]; 34 | 35 | #import "GTMHTTPFetcher.h" 36 | #import "GTMHTTPFetchHistory.h" 37 | 38 | @interface GTMHTTPFetcherService : NSObject { 39 | @private 40 | NSMutableDictionary *delayedHosts_; 41 | NSMutableDictionary *runningHosts_; 42 | NSUInteger maxRunningFetchersPerHost_; 43 | 44 | GTMHTTPFetchHistory *fetchHistory_; 45 | NSOperationQueue *delegateQueue_; 46 | NSArray *runLoopModes_; 47 | NSString *userAgent_; 48 | NSTimeInterval timeout_; 49 | NSURLCredential *credential_; // username & password 50 | NSURLCredential *proxyCredential_; // credential supplied to proxy servers 51 | NSInteger cookieStorageMethod_; 52 | 53 | BOOL shouldFetchInBackground_; 54 | 55 | id authorizer_; 56 | } 57 | 58 | // Create a fetcher 59 | // 60 | // These methods will return an autoreleased fetcher, but if 61 | // the fetcher is successfully created, the connection will retain the 62 | // fetcher for the life of the connection as well. So the caller doesn't have 63 | // to retain the fetcher explicitly unless they want to be able to monitor 64 | // or cancel it. 65 | - (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; 66 | - (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL; 67 | - (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString; 68 | - (id)fetcherWithRequest:(NSURLRequest *)request 69 | fetcherClass:(Class)fetcherClass; 70 | 71 | // Queues of delayed and running fetchers. Each dictionary contains arrays 72 | // of fetchers, keyed by host 73 | // 74 | // A max value of 0 means no fetchers should be delayed. 75 | // 76 | // The default limit is 10 simultaneous fetchers targeting each host. 77 | @property (assign) NSUInteger maxRunningFetchersPerHost; 78 | @property (retain, readonly) NSDictionary *delayedHosts; 79 | @property (retain, readonly) NSDictionary *runningHosts; 80 | 81 | - (BOOL)isDelayingFetcher:(GTMHTTPFetcher *)fetcher; 82 | 83 | - (NSUInteger)numberOfFetchers; // running + delayed fetchers 84 | - (NSUInteger)numberOfRunningFetchers; 85 | - (NSUInteger)numberOfDelayedFetchers; 86 | 87 | // Search for running or delayed fetchers with the specified URL. 88 | // 89 | // Returns an array of fetcher objects found, or nil if none found. 90 | - (NSArray *)issuedFetchersWithRequestURL:(NSURL *)requestURL; 91 | 92 | - (void)stopAllFetchers; 93 | 94 | // Properties to be applied to each fetcher; 95 | // see GTMHTTPFetcher.h for descriptions 96 | @property (copy) NSString *userAgent; 97 | @property (assign) NSTimeInterval timeout; 98 | @property (retain) NSOperationQueue *delegateQueue; 99 | @property (retain) NSArray *runLoopModes; 100 | @property (retain) NSURLCredential *credential; 101 | @property (retain) NSURLCredential *proxyCredential; 102 | @property (assign) BOOL shouldFetchInBackground; 103 | 104 | // Fetch history 105 | @property (retain) GTMHTTPFetchHistory *fetchHistory; 106 | 107 | @property (assign) NSInteger cookieStorageMethod; 108 | @property (assign) BOOL shouldRememberETags; // default: NO 109 | @property (assign) BOOL shouldCacheETaggedData; // default: NO 110 | 111 | - (void)clearETaggedDataCache; 112 | - (void)clearHistory; 113 | 114 | @property (nonatomic, retain) id authorizer; 115 | 116 | // Spin the run loop, discarding events, until all running and delayed fetchers 117 | // have completed 118 | // 119 | // This is only for use in testing or in tools without a user interface. 120 | // 121 | // Synchronous fetches should never be done by shipping apps; they are 122 | // sufficient reason for rejection from the app store. 123 | - (void)waitForCompletionOfAllFetchersWithTimeout:(NSTimeInterval)timeoutInSeconds; 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLQuery.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLQuery.h 18 | // 19 | 20 | // Query documentation: 21 | // https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Query_Operations 22 | 23 | #import "GTLObject.h" 24 | #import "GTLUploadParameters.h" 25 | 26 | @protocol GTLQueryProtocol 27 | - (BOOL)isBatchQuery; 28 | - (BOOL)shouldSkipAuthorization; 29 | - (void)executionDidStop; 30 | - (NSDictionary *)additionalHTTPHeaders; 31 | - (NSDictionary *)urlQueryParameters; 32 | - (GTLUploadParameters *)uploadParameters; 33 | @end 34 | 35 | @protocol GTLQueryCollectionProtocol 36 | @optional 37 | @property (retain) NSString *pageToken; 38 | @property (retain) NSNumber *startIndex; 39 | @end 40 | 41 | @class GTLServiceTicket; 42 | 43 | @interface GTLQuery : NSObject { 44 | @private 45 | NSString *methodName_; 46 | NSMutableDictionary *json_; 47 | GTLObject *bodyObject_; 48 | NSMutableDictionary *childCache_; 49 | NSString *requestID_; 50 | GTLUploadParameters *uploadParameters_; 51 | NSDictionary *urlQueryParameters_; 52 | NSDictionary *additionalHTTPHeaders_; 53 | Class expectedObjectClass_; 54 | BOOL skipAuthorization_; 55 | #if NS_BLOCKS_AVAILABLE 56 | void (^completionBlock_)(GTLServiceTicket *ticket, id object, NSError *error); 57 | #elif !__LP64__ 58 | // Placeholders: for 32-bit builds, keep the size of the object's ivar section 59 | // the same with and without blocks 60 | id completionPlaceholder_; 61 | #endif 62 | } 63 | 64 | // The rpc method name. 65 | @property (readonly) NSString *methodName; 66 | 67 | // The JSON dictionary of all the parameters set on this query. 68 | @property (retain) NSMutableDictionary *JSON; 69 | 70 | // The object set to be uploaded with the query. 71 | @property (retain) GTLObject *bodyObject; 72 | 73 | // Each query must have a request ID string. The user may replace the 74 | // default assigned request ID with a custom string, provided that if 75 | // used in a batch query, all request IDs in the batch must be unique. 76 | @property (copy) NSString *requestID; 77 | 78 | // For queries which support file upload, the MIME type and file handle 79 | // or data must be provided. 80 | @property (copy) GTLUploadParameters *uploadParameters; 81 | 82 | // Any URL query parameters to add to the query (useful for debugging with some 83 | // services). 84 | @property (copy) NSDictionary *urlQueryParameters; 85 | 86 | // Any additional HTTP headers for this query. Not valid when this query 87 | // is added to a batch. 88 | // 89 | // These headers override the same keys from the service object's 90 | // additionalHTTPHeaders. 91 | @property (copy) NSDictionary *additionalHTTPHeaders; 92 | 93 | // The GTLObject subclass expected for results (used if the result doesn't 94 | // include a kind attribute). 95 | @property (assign) Class expectedObjectClass; 96 | 97 | // Clients may set this to YES to disallow authorization. Defaults to NO. 98 | @property (assign) BOOL shouldSkipAuthorization; 99 | 100 | #if NS_BLOCKS_AVAILABLE 101 | // Clients may provide an optional callback block to be called immediately 102 | // before the executeQuery: callback. 103 | // 104 | // The completionBlock property is particularly useful for queries executed 105 | // in a batch. 106 | // 107 | // Errors passed to the completionBlock will have an "underlying" GTLErrorObject 108 | // when the server returned an error for this specific query: 109 | // 110 | // GTLErrorObject *errorObj = [GTLErrorObject underlyingObjectForError:error]; 111 | // if (errorObj) { 112 | // // the server returned this error for this specific query 113 | // } else { 114 | // // the batch execution failed 115 | // } 116 | @property (copy) void (^completionBlock)(GTLServiceTicket *ticket, id object, NSError *error); 117 | #endif 118 | 119 | // methodName is the RPC method name to use. 120 | + (id)queryWithMethodName:(NSString *)methodName GTL_NONNULL((1)); 121 | 122 | // methodName is the RPC method name to use. 123 | - (id)initWithMethodName:(NSString *)method GTL_NONNULL((1)); 124 | 125 | // If you need to set a parameter that is not listed as a property for a 126 | // query class, you can do so via this api. If you need to clear it after 127 | // setting, pass nil for obj. 128 | - (void)setCustomParameter:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); 129 | 130 | // Auto-generated request IDs 131 | + (NSString *)nextRequestID; 132 | 133 | // Methods for subclasses to override. 134 | + (NSDictionary *)parameterNameMap; 135 | + (NSDictionary *)arrayPropertyToClassMap; 136 | @end 137 | 138 | // The library doesn't use GTLQueryCollectionImpl, but it provides a concrete implementation 139 | // of the protocol so the methods do not cause a private method error in Xcode. 140 | @interface GTLQueryCollectionImpl : GTLQuery 141 | @end 142 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMObjC2Runtime.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMObjC2Runtime.h 3 | // 4 | // Copyright 2007-2008 Google Inc. 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 7 | // use this file except in compliance with the License. You may obtain a copy 8 | // of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | // License for the specific language governing permissions and limitations under 16 | // the License. 17 | // 18 | 19 | #import 20 | #import 21 | #import "GTMDefines.h" 22 | 23 | // These functions exist for code that we want to compile on both the < 10.5 24 | // sdks and on the >= 10.5 sdks without warnings. It basically reimplements 25 | // certain parts of the objc2 runtime in terms of the objc1 runtime. It is not 26 | // a complete implementation as I've only implemented the routines I know we 27 | // use. Feel free to add more as necessary. 28 | // These functions are not documented because they conform to the documentation 29 | // for the ObjC2 Runtime. 30 | 31 | #if OBJC_API_VERSION >= 2 // Only have optional and req'd keywords in ObjC2. 32 | #define AT_OPTIONAL @optional 33 | #define AT_REQUIRED @required 34 | #else 35 | #define AT_OPTIONAL 36 | #define AT_REQUIRED 37 | #endif 38 | 39 | // The file objc-runtime.h was moved to runtime.h and in Leopard, objc-runtime.h 40 | // was just a wrapper around runtime.h. For the iPhone SDK, this objc-runtime.h 41 | // is removed in the iPhoneOS2.0 SDK. 42 | // 43 | // The |Object| class was removed in the iPhone2.0 SDK too. 44 | #if GTM_IPHONE_SDK 45 | #import 46 | #import 47 | #else 48 | #import 49 | #import 50 | #endif 51 | 52 | #import 53 | 54 | #if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) 55 | #import "objc/Protocol.h" 56 | 57 | OBJC_EXPORT Class object_getClass(id obj); 58 | OBJC_EXPORT const char *class_getName(Class cls); 59 | OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol); 60 | OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel); 61 | OBJC_EXPORT Class class_getSuperclass(Class cls); 62 | OBJC_EXPORT Method *class_copyMethodList(Class cls, unsigned int *outCount); 63 | OBJC_EXPORT SEL method_getName(Method m); 64 | OBJC_EXPORT void method_exchangeImplementations(Method m1, Method m2); 65 | OBJC_EXPORT IMP method_getImplementation(Method method); 66 | OBJC_EXPORT IMP method_setImplementation(Method method, IMP imp); 67 | OBJC_EXPORT struct objc_method_description protocol_getMethodDescription(Protocol *p, 68 | SEL aSel, 69 | BOOL isRequiredMethod, 70 | BOOL isInstanceMethod); 71 | OBJC_EXPORT BOOL sel_isEqual(SEL lhs, SEL rhs); 72 | 73 | // If building for 10.4 but using the 10.5 SDK, don't include these. 74 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 75 | // atomics 76 | // On Leopard these are GC aware 77 | // Intentionally did not include the non-barrier versions, because I couldn't 78 | // come up with a case personally where you wouldn't want to use the 79 | // barrier versions. 80 | GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate, 81 | void *replacement, 82 | void * volatile *theValue) { 83 | #if defined(__LP64__) && __LP64__ 84 | return OSAtomicCompareAndSwap64Barrier((int64_t)predicate, 85 | (int64_t)replacement, 86 | (int64_t *)theValue); 87 | #else // defined(__LP64__) && __LP64__ 88 | return OSAtomicCompareAndSwap32Barrier((int32_t)predicate, 89 | (int32_t)replacement, 90 | (int32_t *)theValue); 91 | #endif // defined(__LP64__) && __LP64__ 92 | } 93 | 94 | #endif // MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 95 | #endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) 96 | 97 | #if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) 98 | 99 | GTM_INLINE BOOL objc_atomicCompareAndSwapGlobalBarrier(id predicate, 100 | id replacement, 101 | volatile id *objectLocation) { 102 | return OSAtomicCompareAndSwapPtrBarrier(predicate, 103 | replacement, 104 | (void * volatile *)objectLocation); 105 | } 106 | GTM_INLINE BOOL objc_atomicCompareAndSwapInstanceVariableBarrier(id predicate, 107 | id replacement, 108 | volatile id *objectLocation) { 109 | return OSAtomicCompareAndSwapPtrBarrier(predicate, 110 | replacement, 111 | (void * volatile *)objectLocation); 112 | } 113 | #endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) 114 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPUploadFetcher.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTMHTTPUploadFetcher.h 18 | // 19 | 20 | #if (!GDATA_REQUIRE_SERVICE_INCLUDES) || GDATA_INCLUDE_DOCS_SERVICE || \ 21 | GDATA_INCLUDE_YOUTUBE_SERVICE || GDATA_INCLUDE_PHOTOS_SERVICE 22 | 23 | // 24 | // This subclass of GTMHTTPFetcher simulates the series of fetches 25 | // needed for chunked upload as a single fetch operation. 26 | // 27 | // Protocol document: 28 | // http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal 29 | // 30 | // To the client, the only fetcher that exists is this class; the subsidiary 31 | // fetchers needed for uploading chunks are not visible (though the most recent 32 | // chunk fetcher may be accessed via the -activeFetcher method, and 33 | // -responseHeaders and -statusCode reflect results from the most recent chunk 34 | // fetcher.) 35 | // 36 | // Chunk fetchers are discarded as soon as they have completed. 37 | // 38 | 39 | #pragma once 40 | 41 | #import "GTMHTTPFetcher.h" 42 | #import "GTMHTTPFetcherService.h" 43 | 44 | // async retrieval of an http get or post 45 | @interface GTMHTTPUploadFetcher : GTMHTTPFetcher { 46 | GTMHTTPFetcher *chunkFetcher_; 47 | 48 | // we'll call through to the delegate's sentData and finished selectors 49 | SEL delegateSentDataSEL_; 50 | SEL delegateFinishedSEL_; 51 | 52 | BOOL needsManualProgress_; 53 | 54 | // the initial fetch's body length and bytes actually sent are 55 | // needed for calculating progress during subsequent chunk uploads 56 | NSUInteger initialBodyLength_; 57 | NSUInteger initialBodySent_; 58 | 59 | NSURL *locationURL_; 60 | #if NS_BLOCKS_AVAILABLE 61 | void (^locationChangeBlock_)(NSURL *); 62 | #elif !__LP64__ 63 | // placeholders: for 32-bit builds, keep the size of the object's ivar section 64 | // the same with and without blocks 65 | #ifndef __clang_analyzer__ 66 | id locationChangePlaceholder_; 67 | #endif 68 | #endif 69 | 70 | // uploadData_ or uploadFileHandle_ may be set, but not both 71 | NSData *uploadData_; 72 | NSFileHandle *uploadFileHandle_; 73 | NSInteger uploadFileHandleLength_; 74 | NSString *uploadMIMEType_; 75 | NSUInteger chunkSize_; 76 | BOOL isPaused_; 77 | BOOL isRestartedUpload_; 78 | 79 | // we keep the latest offset into the upload data just for 80 | // progress reporting 81 | NSUInteger currentOffset_; 82 | 83 | // we store the response headers and status code for the most recent 84 | // chunk fetcher 85 | NSDictionary *responseHeaders_; 86 | NSInteger statusCode_; 87 | } 88 | 89 | + (GTMHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request 90 | uploadData:(NSData *)data 91 | uploadMIMEType:(NSString *)uploadMIMEType 92 | chunkSize:(NSUInteger)chunkSize 93 | fetcherService:(GTMHTTPFetcherService *)fetcherServiceOrNil; 94 | 95 | + (GTMHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request 96 | uploadFileHandle:(NSFileHandle *)fileHandle 97 | uploadMIMEType:(NSString *)uploadMIMEType 98 | chunkSize:(NSUInteger)chunkSize 99 | fetcherService:(GTMHTTPFetcherService *)fetcherServiceOrNil; 100 | 101 | + (GTMHTTPUploadFetcher *)uploadFetcherWithLocation:(NSURL *)locationURL 102 | uploadFileHandle:(NSFileHandle *)fileHandle 103 | uploadMIMEType:(NSString *)uploadMIMEType 104 | chunkSize:(NSUInteger)chunkSize 105 | fetcherService:(GTMHTTPFetcherService *)fetcherServiceOrNil; 106 | - (void)pauseFetching; 107 | - (void)resumeFetching; 108 | - (BOOL)isPaused; 109 | 110 | @property (retain) NSURL *locationURL; 111 | @property (retain) NSData *uploadData; 112 | @property (retain) NSFileHandle *uploadFileHandle; 113 | @property (copy) NSString *uploadMIMEType; 114 | @property (assign) NSUInteger chunkSize; 115 | @property (assign) NSUInteger currentOffset; 116 | 117 | #if NS_BLOCKS_AVAILABLE 118 | // When the upload location changes, the optional locationChangeBlock will be 119 | // called. It will be called with nil once upload succeeds or can no longer 120 | // be attempted. 121 | @property (copy) void (^locationChangeBlock)(NSURL *locationURL); 122 | #endif 123 | 124 | // the fetcher for the current data chunk, if any 125 | @property (retain) GTMHTTPFetcher *chunkFetcher; 126 | 127 | // the active fetcher is the last chunk fetcher, or the upload fetcher itself 128 | // if no chunk fetcher has yet been created 129 | @property (readonly) GTMHTTPFetcher *activeFetcher; 130 | 131 | // the response headers from the most recently-completed fetch 132 | @property (retain) NSDictionary *responseHeaders; 133 | 134 | // the status code from the most recently-completed fetch 135 | @property (assign) NSInteger statusCode; 136 | 137 | @end 138 | 139 | #endif // #if !GDATA_REQUIRE_SERVICE_INCLUDES 140 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusComment.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusComment.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusComment (0 custom class methods, 11 custom properties) 30 | // GTLPlusCommentActor (0 custom class methods, 4 custom properties) 31 | // GTLPlusCommentInReplyToItem (0 custom class methods, 2 custom properties) 32 | // GTLPlusCommentObject (0 custom class methods, 3 custom properties) 33 | // GTLPlusCommentPlusoners (0 custom class methods, 1 custom properties) 34 | // GTLPlusCommentActorImage (0 custom class methods, 1 custom properties) 35 | 36 | #if GTL_BUILT_AS_FRAMEWORK 37 | #import "GTL/GTLObject.h" 38 | #else 39 | #import "GTLObject.h" 40 | #endif 41 | 42 | @class GTLPlusCommentActor; 43 | @class GTLPlusCommentActorImage; 44 | @class GTLPlusCommentInReplyToItem; 45 | @class GTLPlusCommentObject; 46 | @class GTLPlusCommentPlusoners; 47 | 48 | // ---------------------------------------------------------------------------- 49 | // 50 | // GTLPlusComment 51 | // 52 | 53 | @interface GTLPlusComment : GTLObject 54 | 55 | // The person who posted this comment. 56 | @property (retain) GTLPlusCommentActor *actor; 57 | 58 | // ETag of this response for caching purposes. 59 | @property (copy) NSString *ETag; 60 | 61 | // The ID of this comment. 62 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 63 | @property (copy) NSString *identifier; 64 | 65 | // The activity this comment replied to. 66 | @property (retain) NSArray *inReplyTo; // of GTLPlusCommentInReplyToItem 67 | 68 | // Identifies this resource as a comment. Value: "plus#comment". 69 | @property (copy) NSString *kind; 70 | 71 | // The object of this comment. 72 | @property (retain) GTLPlusCommentObject *object; 73 | 74 | // People who +1'd this comment. 75 | @property (retain) GTLPlusCommentPlusoners *plusoners; 76 | 77 | // The time at which this comment was initially published. Formatted as an RFC 78 | // 3339 timestamp. 79 | @property (retain) GTLDateTime *published; 80 | 81 | // Link to this comment resource. 82 | @property (copy) NSString *selfLink; 83 | 84 | // The time at which this comment was last updated. Formatted as an RFC 3339 85 | // timestamp. 86 | @property (retain) GTLDateTime *updated; 87 | 88 | // This comment's verb, indicating what action was performed. Possible values 89 | // are: 90 | // - "post" - Publish content to the stream. 91 | @property (copy) NSString *verb; 92 | 93 | @end 94 | 95 | 96 | // ---------------------------------------------------------------------------- 97 | // 98 | // GTLPlusCommentActor 99 | // 100 | 101 | @interface GTLPlusCommentActor : GTLObject 102 | 103 | // The name of this actor, suitable for display. 104 | @property (copy) NSString *displayName; 105 | 106 | // The ID of the actor. 107 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 108 | @property (copy) NSString *identifier; 109 | 110 | // The image representation of this actor. 111 | @property (retain) GTLPlusCommentActorImage *image; 112 | 113 | // A link to the Person resource for this actor. 114 | @property (copy) NSString *url; 115 | 116 | @end 117 | 118 | 119 | // ---------------------------------------------------------------------------- 120 | // 121 | // GTLPlusCommentInReplyToItem 122 | // 123 | 124 | @interface GTLPlusCommentInReplyToItem : GTLObject 125 | 126 | // The ID of the activity. 127 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 128 | @property (copy) NSString *identifier; 129 | 130 | // The URL of the activity. 131 | @property (copy) NSString *url; 132 | 133 | @end 134 | 135 | 136 | // ---------------------------------------------------------------------------- 137 | // 138 | // GTLPlusCommentObject 139 | // 140 | 141 | @interface GTLPlusCommentObject : GTLObject 142 | 143 | // The HTML-formatted content, suitable for display. 144 | @property (copy) NSString *content; 145 | 146 | // The object type of this comment. Possible values are: 147 | // - "comment" - A comment in reply to an activity. 148 | @property (copy) NSString *objectType; 149 | 150 | // The content (text) as provided by the author, stored without any HTML 151 | // formatting. When creating or updating a comment, this value must be supplied 152 | // as plain text in the request. 153 | @property (copy) NSString *originalContent; 154 | 155 | @end 156 | 157 | 158 | // ---------------------------------------------------------------------------- 159 | // 160 | // GTLPlusCommentPlusoners 161 | // 162 | 163 | @interface GTLPlusCommentPlusoners : GTLObject 164 | 165 | // Total number of people who +1'd this comment. 166 | @property (retain) NSNumber *totalItems; // unsignedIntValue 167 | 168 | @end 169 | 170 | 171 | // ---------------------------------------------------------------------------- 172 | // 173 | // GTLPlusCommentActorImage 174 | // 175 | 176 | @interface GTLPlusCommentActorImage : GTLObject 177 | 178 | // The URL of the actor's profile photo. To resize the image and crop it to a 179 | // square, append the query string ?sz=x, where x is the dimension in pixels of 180 | // each side. 181 | @property (copy) NSString *url; 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /src/ios/GooglePlus.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AppDelegate.h" 3 | #import "GooglePlus.h" 4 | 5 | // need to swap out a method, so swizzling it here 6 | static void swizzleMethod(Class class, SEL destinationSelector, SEL sourceSelector); 7 | 8 | @implementation AppDelegate (IdentityUrlHandling) 9 | 10 | + (void)load { 11 | swizzleMethod([AppDelegate class], 12 | @selector(application:openURL:sourceApplication:annotation:), 13 | @selector(identity_application:openURL:sourceApplication:annotation:)); 14 | } 15 | 16 | - (BOOL)identity_application: (UIApplication *)application 17 | openURL: (NSURL *)url 18 | sourceApplication: (NSString *)sourceApplication 19 | annotation: (id)annotation { 20 | 21 | GooglePlus* gp = (GooglePlus*)[[self.viewController pluginObjects] objectForKey:@"GooglePlus"]; 22 | 23 | if ([gp isSigningIn]) { 24 | gp.isSigningIn = NO; 25 | return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation]; 26 | } else { 27 | // call super 28 | return [self identity_application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; 29 | } 30 | } 31 | @end 32 | 33 | @implementation GooglePlus 34 | 35 | - (void) login:(CDVInvokedUrlCommand*)command { 36 | self.isSigningIn = YES; 37 | [[self getGooglePlusSignInObject:command] authenticate]; 38 | } 39 | 40 | - (void) trySilentLogin:(CDVInvokedUrlCommand*)command { 41 | // trySilentAuthentication doesn't call delegate when it fails, so handle it here 42 | if (![[self getGooglePlusSignInObject:command] trySilentAuthentication]) { 43 | CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no valid token"]; 44 | [self writeJavascript:[pluginResult toErrorCallbackString:command.callbackId]]; 45 | } 46 | } 47 | 48 | - (GPPSignIn*) getGooglePlusSignInObject:(CDVInvokedUrlCommand*)command { 49 | _callbackId = command.callbackId; 50 | NSDictionary* options = [command.arguments objectAtIndex:0]; 51 | NSString* apiKey = [options objectForKey:@"iOSApiKey"]; 52 | if (apiKey == nil) { 53 | CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"iOSApiKey not set"]; 54 | [self writeJavascript:[pluginResult toErrorCallbackString:_callbackId]]; 55 | return nil; 56 | } 57 | 58 | GPPSignIn *signIn = [GPPSignIn sharedInstance]; 59 | signIn.shouldFetchGooglePlusUser = YES; 60 | signIn.shouldFetchGoogleUserEmail = YES; 61 | signIn.clientID = apiKey; 62 | signIn.scopes = @[kGTLAuthScopePlusLogin]; 63 | signIn.attemptSSO = YES; // tries to use other installed Google apps 64 | signIn.delegate = self; 65 | return signIn; 66 | } 67 | 68 | - (void) logout:(CDVInvokedUrlCommand*)command { 69 | [[GPPSignIn sharedInstance] signOut]; 70 | CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"logged out"]; 71 | [self writeJavascript:[pluginResult toSuccessCallbackString:command.callbackId]]; 72 | } 73 | 74 | - (void) disconnect:(CDVInvokedUrlCommand*)command { 75 | [[GPPSignIn sharedInstance] disconnect]; 76 | CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"disconnected"]; 77 | [self writeJavascript:[pluginResult toSuccessCallbackString:command.callbackId]]; 78 | } 79 | 80 | - (void) share_unused:(CDVInvokedUrlCommand*)command { 81 | // for a rainy day.. see for a (limited) example https://github.com/vleango/GooglePlus-PhoneGap-iOS/blob/master/src/ios/GPlus.m 82 | } 83 | 84 | #pragma mark - GPPSignInDelegate 85 | - (void)finishedWithAuth:(GTMOAuth2Authentication *)auth 86 | error:(NSError *)error { 87 | if (error) { 88 | CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:error.localizedDescription]; 89 | [self writeJavascript:[pluginResult toErrorCallbackString:_callbackId]]; 90 | } else { 91 | NSString *email = [GPPSignIn sharedInstance].userEmail; 92 | NSString *token = [GPPSignIn sharedInstance].idToken; 93 | GTLPlusPerson *person = [GPPSignIn sharedInstance].googlePlusUser; 94 | NSDictionary *result; 95 | 96 | if (person == nil) { 97 | result = @{ 98 | @"email" : email 99 | }; 100 | } else { 101 | result = @{ 102 | @"idToken" : token, 103 | @"email" : email, 104 | @"displayName" : person.displayName ?: [NSNull null], 105 | @"gender" : person.gender ?: [NSNull null], 106 | @"imageUrl" : (person.image != nil && person.image.url != nil) ? person.image.url : [NSNull null], 107 | @"givenName" : (person.name != nil && person.name.givenName != nil) ? person.name.givenName : [NSNull null], 108 | @"middleName" : (person.name != nil && person.name.middleName != nil) ? person.name.middleName : [NSNull null], 109 | @"familyName" : (person.name != nil && person.name.familyName != nil) ? person.name.familyName : [NSNull null], 110 | @"ageRangeMin" : person.ageRange && person.ageRange.min ? person.ageRange.min : [NSNull null], 111 | @"ageRangeMax" : person.ageRange && person.ageRange.max ? person.ageRange.max : [NSNull null], 112 | @"birthday" : person.birthday ?: [NSNull null] 113 | }; 114 | } 115 | CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:result]; 116 | [self writeJavascript:[pluginResult toSuccessCallbackString:_callbackId]]; 117 | } 118 | } 119 | 120 | #pragma mark Swizzling 121 | 122 | @end 123 | 124 | static void swizzleMethod(Class class, SEL destinationSelector, SEL sourceSelector) { 125 | Method destinationMethod = class_getInstanceMethod(class, destinationSelector); 126 | Method sourceMethod = class_getInstanceMethod(class, sourceSelector); 127 | 128 | // If the method doesn't exist, add it. If it does exist, replace it with the given implementation. 129 | if (class_addMethod(class, destinationSelector, method_getImplementation(sourceMethod), method_getTypeEncoding(sourceMethod))) { 130 | class_replaceMethod(class, destinationSelector, method_getImplementation(destinationMethod), method_getTypeEncoding(destinationMethod)); 131 | } else { 132 | method_exchangeImplementations(destinationMethod, sourceMethod); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Google+ Cordova/PhoneGap Plugin 2 | by [Eddy Verbruggen](http://twitter.com/eddyverbruggen) 3 | 4 | ## 0. Index 5 | 6 | 1. [Description](#1-description) 7 | 2. [Screenshots](#2-screenshots) 8 | 3. [Installation (CLI / Plugman)](#3-installation-phonegap-cli--cordova-cli) 9 | 4. [Google+ API setup](#4-google-api-setup) 10 | 5. [Usage](#5-usage) 11 | 6. [Changelog](#6-changelog) 12 | 7. [License](#7-license) 13 | 14 | ## 1. Description 15 | 16 | This plugin allows you to log on with your Google account on iOS and Android. 17 | You will not only get the email address of the user, but also stuff like their full name and gender. 18 | 19 | ## 2. Screenshots 20 | 21 | Android 22 | 23 |   24 |   25 | 26 | 27 | iOS 28 | 29 |   30 |   31 |   32 | 33 | ## 3. Installation (PhoneGap CLI / Cordova CLI) 34 | This plugin is compatible with [Cordova Plugman](https://github.com/apache/cordova-plugman), compatible with [PhoneGap 3.0 CLI](http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface_add_features), here's how it works with the CLI (backup your project first!): 35 | 36 | ``` 37 | $ phonegap local plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git 38 | ``` 39 | or, my personal preference 40 | ``` 41 | $ cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git 42 | $ cordova prepare 43 | ``` 44 | 45 | GooglePlus.js is brought in automatically. There is no need to change or add anything in your html. 46 | 47 | ## 4. Google+ API setup 48 | To communicate with Google+ you need to do some tedious setup, sorry. 49 | 50 | ### iOS 51 | To get your iOS API key, follow Step 1 of [this guide](https://developers.google.com/+/quickstart/ios) 52 | 53 | ### Android 54 | To configure Android, follow Step 1 of [this guide](https://developers.google.com/+/quickstart/android) 55 | 56 | ## 5. Usage 57 | Check the [demo app](demo) to get you going quickly, or hurt yourself and follow these steps. 58 | 59 | Note that none of these methods should be called before [`deviceready`](http://docs.phonegap.com/en/edge/cordova_events_events.md.html#deviceready) has fired. 60 | 61 | ### Login 62 | ```javascript 63 | window.plugins.googleplus.login( 64 | { 65 | 'iOSApiKey': '1234567890-abcdefghijklm74bfw.apps.googleusercontent.com' 66 | }, 67 | function (obj) { 68 | alert(JSON.stringify(obj)); // do something useful instead of alerting 69 | }, 70 | function (msg) { 71 | alert('error: ' + msg); 72 | } 73 | ); 74 | ``` 75 | 76 | Note that if you're only targeting Android you can pass `{}` for the first argument. 77 | 78 | The success callback (second argument) gets a JSON object with the following contents, with example data of my Google+ account: 79 | ```javascript 80 | obj.idToken // 'eyJdhzhJ...' 81 | obj.email // 'eddyverbruggen@gmail.com' 82 | obj.displayName // 'Eddy Verbruggen' 83 | obj.gender // 'male' (other options are 'female' and 'unknown' 84 | obj.imageUrl // 'http://link-to-my-profilepic.google.com' 85 | obj.givenName // 'Eddy' 86 | obj.middleName // null (or undefined, depending on the platform) 87 | obj.familyName // 'Verbruggen' 88 | obj.birthday // '1977-04-22' 89 | obj.ageRangeMin // 21 (or null or undefined or a different number) 90 | obj.ageRangeMax // null (or undefined or a number) 91 | ``` 92 | 93 | *NOTE: The idToken property is only returned on iOS only.* 94 | 95 | ### Try silent login 96 | When the user comes back to your app and you're not sure if he needs to log in, 97 | you can call `trySilentLogin` to try logging him in. 98 | 99 | If it succeeds you will get the same object as the `login` function gets, 100 | but if it fails it will not show the authentication dialog to the user. 101 | 102 | The code is exactly the same a `login`, except for the function name. 103 | ```javascript 104 | window.plugins.googleplus.trySilentLogin( 105 | { 106 | 'iOSApiKey': '1234567890-abcdefghijklm74bfw.apps.googleusercontent.com' 107 | }, 108 | function (obj) { 109 | alert(JSON.stringify(obj)); // do something useful instead of alerting 110 | }, 111 | function (msg) { 112 | alert('error: ' + msg); 113 | } 114 | ); 115 | ``` 116 | 117 | ### logout 118 | This will clear the OAuth2 token. 119 | ``` javascript 120 | window.plugins.googleplus.logout( 121 | function (msg) { 122 | alert(msg); // do something useful instead of alerting 123 | } 124 | ); 125 | ``` 126 | 127 | ### disconnect 128 | This will clear the OAuth2 token and forget which account was used to login. 129 | On Android this will always force the user to authenticate the app again, 130 | on iOS using logout seems to do the job already. Need to investigate this a bit more.. 131 | ``` javascript 132 | window.plugins.googleplus.disconnect( 133 | function (msg) { 134 | alert(msg); // do something useful instead of alerting 135 | } 136 | ); 137 | ``` 138 | 139 | ## 6. CHANGELOG 140 | 1.0.0: initial version supporting iOS and Android 141 | 142 | ## 7. License 143 | 144 | [The MIT License (MIT)](http://www.opensource.org/licenses/mit-license.html) 145 | 146 | Permission is hereby granted, free of charge, to any person obtaining a copy 147 | of this software and associated documentation files (the "Software"), to deal 148 | in the Software without restriction, including without limitation the rights 149 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 150 | copies of the Software, and to permit persons to whom the Software is 151 | furnished to do so, subject to the following conditions: 152 | 153 | The above copyright notice and this permission notice shall be included in 154 | all copies or substantial portions of the Software. 155 | 156 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 157 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 158 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 159 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 160 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 161 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 162 | THE SOFTWARE. 163 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetchHistory.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTMHTTPFetchHistory.h 18 | // 19 | 20 | // 21 | // Users of the GTMHTTPFetcher class may optionally create and set a fetch 22 | // history object. The fetch history provides "memory" between subsequent 23 | // fetches, including: 24 | // 25 | // - For fetch responses with Etag headers, the fetch history 26 | // remembers the response headers. Future fetcher requests to the same URL 27 | // will be given an "If-None-Match" header, telling the server to return 28 | // a 304 Not Modified status if the response is unchanged, reducing the 29 | // server load and network traffic. 30 | // 31 | // - Optionally, the fetch history can cache the ETagged data that was returned 32 | // in the responses that contained Etag headers. If a later fetch 33 | // results in a 304 status, the fetcher will return the cached ETagged data 34 | // to the client along with a 200 status, hiding the 304. 35 | // 36 | // - The fetch history can track cookies. 37 | // 38 | 39 | #pragma once 40 | 41 | #import 42 | 43 | #import "GTMHTTPFetcher.h" 44 | 45 | // default data cache size for when we're caching responses to handle "not 46 | // modified" errors for the client 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | extern const NSUInteger kGTMDefaultETaggedDataCacheMemoryCapacity; 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | // forward declarations 59 | @class GTMURLCache; 60 | @class GTMCookieStorage; 61 | 62 | @interface GTMHTTPFetchHistory : NSObject { 63 | @private 64 | GTMURLCache *etaggedDataCache_; 65 | BOOL shouldRememberETags_; 66 | BOOL shouldCacheETaggedData_; // if NO, then only headers are cached 67 | GTMCookieStorage *cookieStorage_; 68 | } 69 | 70 | // With caching enabled, previously-cached data will be returned instead of 71 | // 304 Not Modified responses when repeating a fetch of an URL that previously 72 | // included an ETag header in its response 73 | @property (assign) BOOL shouldRememberETags; // default: NO 74 | @property (assign) BOOL shouldCacheETaggedData; // default: NO 75 | 76 | // the default ETag data cache capacity is kGTMDefaultETaggedDataCacheMemoryCapacity 77 | @property (assign) NSUInteger memoryCapacity; 78 | 79 | @property (retain) GTMCookieStorage *cookieStorage; 80 | 81 | - (id)initWithMemoryCapacity:(NSUInteger)totalBytes 82 | shouldCacheETaggedData:(BOOL)shouldCacheETaggedData; 83 | 84 | - (void)updateRequest:(NSMutableURLRequest *)request isHTTPGet:(BOOL)isHTTPGet; 85 | 86 | - (void)clearETaggedDataCache; 87 | - (void)clearHistory; 88 | 89 | - (void)removeAllCookies; 90 | 91 | @end 92 | 93 | 94 | // GTMURLCache and GTMCachedURLResponse have interfaces similar to their 95 | // NSURLCache counterparts, in hopes that someday the NSURLCache versions 96 | // can be used. But in 10.5.8, those are not reliable enough except when 97 | // used with +setSharedURLCache. Our goal here is just to cache 98 | // responses for handling If-None-Match requests that return 99 | // "Not Modified" responses, not for replacing the general URL 100 | // caches. 101 | 102 | @interface GTMCachedURLResponse : NSObject { 103 | @private 104 | NSURLResponse *response_; 105 | NSData *data_; 106 | NSDate *useDate_; // date this response was last saved or used 107 | NSDate *reservationDate_; // date this response's ETag was used 108 | } 109 | 110 | @property (readonly) NSURLResponse* response; 111 | @property (readonly) NSData* data; 112 | 113 | // date the response was saved or last accessed 114 | @property (retain) NSDate *useDate; 115 | 116 | // date the response's ETag header was last used for a fetch request 117 | @property (retain) NSDate *reservationDate; 118 | 119 | - (id)initWithResponse:(NSURLResponse *)response data:(NSData *)data; 120 | @end 121 | 122 | @interface GTMURLCache : NSObject { 123 | NSMutableDictionary *responses_; // maps request URL to GTMCachedURLResponse 124 | NSUInteger memoryCapacity_; // capacity of NSDatas in the responses 125 | NSUInteger totalDataSize_; // sum of sizes of NSDatas of all responses 126 | NSTimeInterval reservationInterval_; // reservation expiration interval 127 | } 128 | 129 | @property (assign) NSUInteger memoryCapacity; 130 | 131 | - (id)initWithMemoryCapacity:(NSUInteger)totalBytes; 132 | 133 | - (GTMCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request; 134 | - (void)storeCachedResponse:(GTMCachedURLResponse *)cachedResponse forRequest:(NSURLRequest *)request; 135 | - (void)removeCachedResponseForRequest:(NSURLRequest *)request; 136 | - (void)removeAllCachedResponses; 137 | 138 | // for unit testing 139 | - (void)setReservationInterval:(NSTimeInterval)secs; 140 | - (NSDictionary *)responses; 141 | - (NSUInteger)totalDataSize; 142 | @end 143 | 144 | @interface GTMCookieStorage : NSObject { 145 | @private 146 | // The cookie storage object manages an array holding cookies, but the array 147 | // is allocated externally (it may be in a fetcher object or the static 148 | // fetcher cookie array.) See the fetcher's setCookieStorageMethod: 149 | // for allocation of this object and assignment of its cookies array. 150 | NSMutableArray *cookies_; 151 | } 152 | 153 | // add all NSHTTPCookies in the supplied array to the storage array, 154 | // replacing cookies in the storage array as appropriate 155 | // Side effect: removes expired cookies from the storage array 156 | - (void)setCookies:(NSArray *)newCookies; 157 | 158 | // retrieve all cookies appropriate for the given URL, considering 159 | // domain, path, cookie name, expiration, security setting. 160 | // Side effect: removes expired cookies from the storage array 161 | - (NSArray *)cookiesForURL:(NSURL *)theURL; 162 | 163 | // return a cookie with the same name, domain, and path as the 164 | // given cookie, or else return nil if none found 165 | // 166 | // Both the cookie being tested and all stored cookies should 167 | // be valid (non-nil name, domains, paths) 168 | - (NSHTTPCookie *)cookieMatchingCookie:(NSHTTPCookie *)cookie; 169 | 170 | // remove any expired cookies, excluding cookies with nil expirations 171 | - (void)removeExpiredCookies; 172 | 173 | - (void)removeAllCookies; 174 | 175 | @end 176 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2SignIn.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // This sign-in object opens and closes the web view window as needed for 18 | // users to sign in. For signing in to Google, it also obtains 19 | // the authenticated user's email address. 20 | // 21 | // Typically, this will be managed for the application by 22 | // GTMOAuth2ViewControllerTouch or GTMOAuth2WindowController, so this 23 | // class's interface is interesting only if 24 | // you are creating your own window controller for sign-in. 25 | // 26 | // 27 | // Delegate methods implemented by the window controller 28 | // 29 | // The window controller implements two methods for use by the sign-in object, 30 | // the webRequestSelector and the finishedSelector: 31 | // 32 | // webRequestSelector has a signature matching 33 | // - (void)signIn:(GTMOAuth2SignIn *)signIn displayRequest:(NSURLRequest *)request 34 | // 35 | // The web request selector will be invoked with a request to be displayed, or 36 | // nil to close the window when the final callback request has been encountered. 37 | // 38 | // 39 | // finishedSelector has a signature matching 40 | // - (void)signin:(GTMOAuth2SignIn *)signin finishedWithAuth:(GTMOAuth2Authentication *)auth error:(NSError *)error 41 | // 42 | // The finished selector will be invoked when sign-in has completed, except 43 | // when explicitly canceled by calling cancelSigningIn 44 | // 45 | 46 | #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES 47 | 48 | #import 49 | #import 50 | 51 | // GTMHTTPFetcher brings in GTLDefines/GDataDefines 52 | #import "GTMHTTPFetcher.h" 53 | 54 | #import "GTMOAuth2Authentication.h" 55 | 56 | @interface GTMOAuth2SignIn : NSObject { 57 | @private 58 | GTMOAuth2Authentication *auth_; 59 | 60 | // the endpoint for displaying the sign-in page 61 | NSURL *authorizationURL_; 62 | NSDictionary *additionalAuthorizationParameters_; 63 | 64 | id delegate_; 65 | SEL webRequestSelector_; 66 | SEL finishedSelector_; 67 | 68 | BOOL hasHandledCallback_; 69 | 70 | GTMHTTPFetcher *pendingFetcher_; 71 | 72 | #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT 73 | BOOL shouldFetchGoogleUserEmail_; 74 | BOOL shouldFetchGoogleUserProfile_; 75 | NSDictionary *userProfile_; 76 | #endif 77 | 78 | SCNetworkReachabilityRef reachabilityRef_; 79 | NSTimer *networkLossTimer_; 80 | NSTimeInterval networkLossTimeoutInterval_; 81 | BOOL hasNotifiedNetworkLoss_; 82 | 83 | id userData_; 84 | } 85 | 86 | @property (nonatomic, retain) GTMOAuth2Authentication *authentication; 87 | 88 | @property (nonatomic, retain) NSURL *authorizationURL; 89 | @property (nonatomic, retain) NSDictionary *additionalAuthorizationParameters; 90 | 91 | // The delegate is released when signing in finishes or is cancelled 92 | @property (nonatomic, retain) id delegate; 93 | @property (nonatomic, assign) SEL webRequestSelector; 94 | @property (nonatomic, assign) SEL finishedSelector; 95 | 96 | @property (nonatomic, retain) id userData; 97 | 98 | // By default, signing in to Google will fetch the user's email, but will not 99 | // fetch the user's profile. 100 | // 101 | // The email is saved in the auth object. 102 | // The profile is available immediately after sign-in. 103 | #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT 104 | @property (nonatomic, assign) BOOL shouldFetchGoogleUserEmail; 105 | @property (nonatomic, assign) BOOL shouldFetchGoogleUserProfile; 106 | @property (nonatomic, retain, readonly) NSDictionary *userProfile; 107 | #endif 108 | 109 | // The default timeout for an unreachable network during display of the 110 | // sign-in page is 30 seconds; set this to 0 to have no timeout 111 | @property (nonatomic, assign) NSTimeInterval networkLossTimeoutInterval; 112 | 113 | // The delegate is retained until sign-in has completed or been canceled 114 | // 115 | // designated initializer 116 | - (id)initWithAuthentication:(GTMOAuth2Authentication *)auth 117 | authorizationURL:(NSURL *)authorizationURL 118 | delegate:(id)delegate 119 | webRequestSelector:(SEL)webRequestSelector 120 | finishedSelector:(SEL)finishedSelector; 121 | 122 | // A default authentication object for signing in to Google services 123 | #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT 124 | + (GTMOAuth2Authentication *)standardGoogleAuthenticationForScope:(NSString *)scope 125 | clientID:(NSString *)clientID 126 | clientSecret:(NSString *)clientSecret; 127 | #endif 128 | 129 | #pragma mark Methods used by the Window Controller 130 | 131 | // Start the sequence of fetches and sign-in window display for sign-in 132 | - (BOOL)startSigningIn; 133 | 134 | // Stop any pending fetches, and close the window (but don't call the 135 | // delegate's finishedSelector) 136 | - (void)cancelSigningIn; 137 | 138 | // Window controllers must tell the sign-in object about any redirect 139 | // requested by the web view, and any changes in the webview window title 140 | // 141 | // If these return YES then the event was handled by the 142 | // sign-in object (typically by closing the window) and should be ignored by 143 | // the window controller's web view 144 | 145 | - (BOOL)requestRedirectedToRequest:(NSURLRequest *)redirectedRequest; 146 | - (BOOL)titleChanged:(NSString *)title; 147 | - (BOOL)cookiesChanged:(NSHTTPCookieStorage *)cookieStorage; 148 | - (BOOL)loadFailedWithError:(NSError *)error; 149 | 150 | // Window controllers must tell the sign-in object if the window was closed 151 | // prematurely by the user (but not by the sign-in object); this calls the 152 | // delegate's finishedSelector 153 | - (void)windowWasClosed; 154 | 155 | // Start the sequences for signing in with an authorization code. The 156 | // authentication must contain an authorization code, otherwise the process 157 | // will fail. 158 | - (void)authCodeObtained; 159 | 160 | #pragma mark - 161 | 162 | #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT 163 | // Revocation of an authorized token from Google 164 | + (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth; 165 | 166 | // Create a fetcher for obtaining the user's Google email address or profile, 167 | // according to the current auth scopes. 168 | // 169 | // The auth object must have been created with appropriate scopes. 170 | // 171 | // The fetcher's response data can be parsed with NSJSONSerialization. 172 | + (GTMHTTPFetcher *)userInfoFetcherWithAuth:(GTMOAuth2Authentication *)auth; 173 | #endif 174 | 175 | #pragma mark - 176 | 177 | // Standard authentication values 178 | + (NSString *)nativeClientRedirectURI; 179 | #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT 180 | + (NSURL *)googleAuthorizationURL; 181 | + (NSURL *)googleTokenURL; 182 | + (NSURL *)googleUserInfoURL; 183 | #endif 184 | 185 | @end 186 | 187 | #endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES 188 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLObject.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLObject.h 18 | // 19 | 20 | // GTLObject documentation: 21 | // https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Objects_and_Queries 22 | 23 | #import 24 | 25 | #import "GTLDefines.h" 26 | #import "GTLUtilities.h" 27 | #import "GTLDateTime.h" 28 | 29 | @protocol GTLCollectionProtocol 30 | @optional 31 | @property (retain) NSArray *items; 32 | @end 33 | 34 | @protocol GTLBatchItemCreationProtocol 35 | - (void)createItemsWithClassMap:(NSDictionary *)batchClassMap; 36 | @end 37 | 38 | @interface GTLObject : NSObject { 39 | 40 | @private 41 | 42 | NSMutableDictionary *json_; 43 | 44 | // Used when creating the subobjects from this one. 45 | NSDictionary *surrogates_; 46 | 47 | // Any complex object hung off this object goes into the cache so the 48 | // next fetch will get the same object back instead of having to recreate 49 | // it. 50 | NSMutableDictionary *childCache_; 51 | 52 | // Anything defined by the client; retained but not used internally; not 53 | // copied by copyWithZone: 54 | NSMutableDictionary *userProperties_; 55 | } 56 | 57 | @property (nonatomic, retain) NSMutableDictionary *JSON; 58 | @property (nonatomic, retain) NSDictionary *surrogates; 59 | @property (nonatomic, retain) NSMutableDictionary *userProperties; 60 | 61 | /////////////////////////////////////////////////////////////////////////////// 62 | // 63 | // Public methods 64 | // 65 | // These methods are intended for users of the library 66 | // 67 | 68 | + (id)object; 69 | + (id)objectWithJSON:(NSMutableDictionary *)dict; 70 | 71 | - (id)copyWithZone:(NSZone *)zone; 72 | 73 | - (NSString *)JSONString; 74 | 75 | // generic access to json; also creates it if necessary 76 | - (void)setJSONValue:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); 77 | - (id)JSONValueForKey:(NSString *)key; 78 | 79 | // Returns the list of keys in this object's JSON that aren't listed as 80 | // properties on the object. 81 | - (NSArray *)additionalJSONKeys; 82 | 83 | // Any keys in the JSON that aren't listed as @properties on the object 84 | // are counted as "additional properties". These allow you to get/set them. 85 | - (id)additionalPropertyForName:(NSString *)name; 86 | - (void)setAdditionalProperty:(id)obj forName:(NSString *)name GTL_NONNULL((2)); 87 | - (NSDictionary *)additionalProperties; 88 | 89 | // User properties are supported for client convenience, but are not copied by 90 | // copyWithZone. User Properties keys beginning with _ are reserved by the library. 91 | // 92 | // Set nil for obj to remove the property. 93 | - (void)setProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); 94 | - (id)propertyForKey:(NSString *)key GTL_NONNULL((1)); 95 | 96 | // userData is stored as a property with key "_userData" 97 | - (void)setUserData:(id)obj; 98 | - (id)userData; 99 | 100 | // Makes a partial query-compatible string describing the fields present 101 | // in this object. (Note: only the first element of any array is examined.) 102 | // 103 | // http://code.google.com/apis/tasks/v1/performance.html#partial 104 | // 105 | - (NSString *)fieldsDescription; 106 | 107 | // Makes an object containing only the changes needed to do a partial update 108 | // (patch), where the patch would be to change an object from the original 109 | // to the receiver, such as 110 | // 111 | // GTLSomeObject *patchObject = [newVersion patchObjectFromOriginal:oldVersion]; 112 | // 113 | // http://code.google.com/apis/tasks/v1/performance.html#patch 114 | // 115 | // NOTE: this method returns nil if there are no changes between the original 116 | // and the receiver. 117 | - (id)patchObjectFromOriginal:(GTLObject *)original; 118 | 119 | // Method creating a null value to set object properties for patch queries that 120 | // delete fields. Do not use this except when setting an object property for 121 | // a patch query. 122 | + (id)nullValue; 123 | 124 | /////////////////////////////////////////////////////////////////////////////// 125 | // 126 | // Protected methods 127 | // 128 | // These methods are intended for subclasses of GTLObject 129 | // 130 | 131 | // class registration ("kind" strings) for subclasses 132 | + (Class)registeredObjectClassForKind:(NSString *)kind; 133 | + (void)registerObjectClassForKind:(NSString *)kind; 134 | 135 | // creation of objects from a JSON dictionary 136 | + (GTLObject *)objectForJSON:(NSMutableDictionary *)json 137 | defaultClass:(Class)defaultClass 138 | surrogates:(NSDictionary *)surrogates 139 | batchClassMap:(NSDictionary *)batchClassMap; 140 | 141 | // property-to-key mapping (for JSON keys which are not used as method names) 142 | + (NSDictionary *)propertyToJSONKeyMap; 143 | 144 | // property-to-Class mapping for array properties (to say what is in the array) 145 | + (NSDictionary *)arrayPropertyToClassMap; 146 | 147 | // The default class for additional JSON keys 148 | + (Class)classForAdditionalProperties; 149 | 150 | @end 151 | 152 | // Collection objects with an "items" property should derive from GTLCollection 153 | // object. This provides support for fast object enumeration, the 154 | // itemAtIndex: convenience method, and indexed subscripts. 155 | // 156 | // Subclasses must implement the items method dynamically. 157 | @interface GTLCollectionObject : GTLObject { 158 | @private 159 | NSDictionary *identifierMap_; 160 | } 161 | 162 | // itemAtIndex: and objectAtIndexedSubscript: return nil when the index exceeds 163 | // the bounds of the items array. 164 | - (id)itemAtIndex:(NSUInteger)idx; 165 | 166 | - (id)objectAtIndexedSubscript:(NSInteger)idx; 167 | 168 | // itemForIdentifier: looks up items from the collection object by identifier, 169 | // and returns the first one. 170 | // 171 | // Typically, items will have a unique identifier (with key "id" in the 172 | // object's JSON). This method returns the first item found in the collection 173 | // with the specified identifier. 174 | // 175 | // The first time this method is used, the collection will cache a map of 176 | // identifiers to items. If the items list for the instance somehow changes, 177 | // use the reset method below to force a new cache to be created for this 178 | // collection. 179 | - (id)itemForIdentifier:(NSString *)key GTL_NONNULL((1)); 180 | 181 | // Identifiers for all items are cached when the first one is obtained. 182 | // This method resets the cache. It is needed only if the item list has 183 | // changed. 184 | - (void)resetIdentifierMap; 185 | 186 | @end 187 | 188 | @interface GTLCollectionObject (DynamicMethods) 189 | - (NSArray *)items; 190 | @end 191 | 192 | // Base object use for when an service method directly returns an array instead 193 | // of an object. Normally methods should return an object with an 'items' 194 | // property, but this exists for the methods not up to spec. 195 | @interface GTLResultArray : GTLCollectionObject 196 | // This method should only be called by subclasses. 197 | - (NSArray *)itemsWithItemClass:(Class)itemClass; 198 | @end 199 | -------------------------------------------------------------------------------- /src/android/GooglePlus.java: -------------------------------------------------------------------------------- 1 | package nl.xservices.plugins; 2 | 3 | import android.app.Activity; 4 | import android.app.PendingIntent; 5 | import android.content.Intent; 6 | import android.content.IntentSender; 7 | import android.os.Bundle; 8 | import com.google.android.gms.common.ConnectionResult; 9 | import com.google.android.gms.common.api.GoogleApiClient; 10 | import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; 11 | import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; 12 | import com.google.android.gms.common.api.ResultCallback; 13 | import com.google.android.gms.common.api.Status; 14 | import com.google.android.gms.plus.Plus; 15 | import com.google.android.gms.plus.model.people.Person; 16 | import org.apache.cordova.*; 17 | import org.json.JSONException; 18 | import org.json.JSONObject; 19 | 20 | public class GooglePlus extends CordovaPlugin implements ConnectionCallbacks, OnConnectionFailedListener { 21 | 22 | public static final String ACTION_LOGIN = "login"; 23 | public static final String ACTION_TRY_SILENT_LOGIN = "trySilentLogin"; 24 | public static final String ACTION_LOGOUT = "logout"; 25 | public static final String ACTION_DISCONNECT = "disconnect"; 26 | 27 | // Wraps our service connection to Google Play services and provides access to the users sign in state and Google APIs 28 | private GoogleApiClient mGoogleApiClient; 29 | private CallbackContext savedCallbackContext; 30 | private boolean trySilentLogin; 31 | private boolean loggingOut; 32 | 33 | @Override 34 | public void initialize(CordovaInterface cordova, CordovaWebView webView) { 35 | super.initialize(cordova, webView); 36 | mGoogleApiClient = buildGoogleApiClient(); 37 | } 38 | 39 | @Override 40 | public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException { 41 | this.savedCallbackContext = callbackContext; 42 | 43 | if (ACTION_LOGIN.equals(action)) { 44 | this.trySilentLogin = false; 45 | mGoogleApiClient.connect(); 46 | 47 | } else if (ACTION_TRY_SILENT_LOGIN.equals(action)) { 48 | this.trySilentLogin = true; 49 | mGoogleApiClient.connect(); 50 | 51 | } else if (ACTION_LOGOUT.equals(action)) { 52 | try { 53 | Plus.AccountApi.clearDefaultAccount(mGoogleApiClient); 54 | mGoogleApiClient.disconnect(); 55 | // needed in onActivityResult when the connect method below comes back 56 | loggingOut = true; 57 | mGoogleApiClient = buildGoogleApiClient(); 58 | mGoogleApiClient.connect(); 59 | } catch (IllegalStateException e) { 60 | savedCallbackContext.success("logged out"); 61 | } 62 | 63 | } else if (ACTION_DISCONNECT.equals(action)) { 64 | disconnect(); 65 | } 66 | return true; 67 | } 68 | 69 | private void disconnect() { 70 | try { 71 | Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient) 72 | .setResultCallback(new ResultCallback() { 73 | @Override 74 | public void onResult(Status status) { 75 | // mGoogleApiClient is now disconnected and access has been revoked. 76 | // Don't care if it was disconnected already (status != success). 77 | mGoogleApiClient = buildGoogleApiClient(); 78 | savedCallbackContext.success("disconnected"); 79 | } 80 | }); 81 | } catch (IllegalStateException e) { 82 | savedCallbackContext.success("disconnected"); 83 | } 84 | } 85 | 86 | private GoogleApiClient buildGoogleApiClient() { 87 | return new GoogleApiClient.Builder(webView.getContext()) 88 | .addConnectionCallbacks(this) 89 | .addOnConnectionFailedListener(this) 90 | .addApi(Plus.API, Plus.PlusOptions.builder().build()) 91 | .addScope(Plus.SCOPE_PLUS_LOGIN) 92 | .build(); 93 | } 94 | 95 | /** 96 | * onConnected is called when our Activity successfully connects to Google 97 | * Play services. onConnected indicates that an account was selected on the 98 | * device, that the selected account has granted any requested permissions to 99 | * our app and that we were able to establish a service connection to Google 100 | * Play services. 101 | */ 102 | @Override 103 | public void onConnected(Bundle connectionHint) { 104 | final String email = Plus.AccountApi.getAccountName(mGoogleApiClient); 105 | final Person user = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient); 106 | 107 | final JSONObject result = new JSONObject(); 108 | try { 109 | result.put("email", email); 110 | // in case there was no internet connection, this may be null 111 | if (user != null) { 112 | result.put("displayName", user.getDisplayName()); 113 | result.put("gender", getGender(user.getGender())); 114 | if (user.getImage() != null) { 115 | result.put("imageUrl", user.getImage().getUrl()); 116 | } 117 | if (user.getName() != null) { 118 | result.put("givenName", user.getName().getGivenName()); 119 | result.put("middleName", user.getName().getMiddleName()); 120 | result.put("familyName", user.getName().getFamilyName()); 121 | if (user.hasAgeRange()) { 122 | if (user.getAgeRange().hasMin()) { 123 | result.put("ageRangeMin", user.getAgeRange().getMin()); 124 | } 125 | if (user.getAgeRange().hasMax()) { 126 | result.put("ageRangeMax", user.getAgeRange().getMax()); 127 | } 128 | } 129 | if (user.hasBirthday()) { 130 | result.put("birthday", user.getBirthday()); 131 | } 132 | } 133 | } 134 | savedCallbackContext.success(result); 135 | } catch (JSONException e) { 136 | this.savedCallbackContext.error("result parsing trouble, error: " + e.getMessage()); 137 | } 138 | } 139 | 140 | // same as iOS values 141 | private static String getGender(int gender) { 142 | switch (gender) { 143 | case 0: 144 | return "male"; 145 | case 1: 146 | return "female"; 147 | default: 148 | return "other"; 149 | } 150 | } 151 | 152 | @Override 153 | public void onConnectionSuspended(int constantInClass_ConnectionCallbacks) { 154 | this.savedCallbackContext.error("connection trouble, code: " + constantInClass_ConnectionCallbacks); 155 | } 156 | 157 | /** 158 | * onConnectionFailed is called when our Activity could not connect to Google Play services. 159 | * onConnectionFailed indicates that the user needs to select an account, grant permissions or resolve an error in order to sign in. 160 | */ 161 | @Override 162 | public void onConnectionFailed(ConnectionResult result) { 163 | if (result.getErrorCode() == ConnectionResult.SERVICE_MISSING) { // e.g. emulator without play services installed 164 | this.savedCallbackContext.error("service not available"); 165 | } else if (loggingOut) { 166 | loggingOut = false; 167 | this.savedCallbackContext.success("logged out"); 168 | } else if (result.getErrorCode() == ConnectionResult.SIGN_IN_REQUIRED && !trySilentLogin) { 169 | final PendingIntent mSignInIntent = result.getResolution(); 170 | try { 171 | // startIntentSenderForResult is started from the CordovaActivity, 172 | // set callback to this plugin to make sure this.onActivityResult gets called afterwards 173 | ((CordovaActivity) this.cordova.getActivity()).setActivityResultCallback(this); 174 | this.cordova.getActivity().startIntentSenderForResult(mSignInIntent.getIntentSender(), 0, null, 0, 0, 0); 175 | } catch (IntentSender.SendIntentException ignore) { 176 | mGoogleApiClient.connect(); 177 | } 178 | } else { 179 | this.savedCallbackContext.error("no valid token"); 180 | } 181 | } 182 | 183 | @Override 184 | public void onActivityResult(int requestCode, final int resultCode, final Intent intent) { 185 | super.onActivityResult(requestCode, resultCode, intent); 186 | if (resultCode == Activity.RESULT_OK) { 187 | mGoogleApiClient.connect(); 188 | } else { 189 | this.savedCallbackContext.error("user cancelled"); 190 | } 191 | } 192 | } -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusItemScope.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLPlusItemScope.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLPlusItemScope (0 custom class methods, 55 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLObject.h" 33 | #else 34 | #import "GTLObject.h" 35 | #endif 36 | 37 | @class GTLPlusItemScope; 38 | 39 | // ---------------------------------------------------------------------------- 40 | // 41 | // GTLPlusItemScope 42 | // 43 | 44 | @interface GTLPlusItemScope : GTLObject 45 | 46 | // The subject matter of the content. 47 | @property (retain) GTLPlusItemScope *about; 48 | 49 | // An additional name for a Person, can be used for a middle name. 50 | @property (retain) NSArray *additionalName; // of NSString 51 | 52 | // Postal address. 53 | @property (retain) GTLPlusItemScope *address; 54 | 55 | // Address country. 56 | @property (copy) NSString *addressCountry; 57 | 58 | // Address locality. 59 | @property (copy) NSString *addressLocality; 60 | 61 | // Address region. 62 | @property (copy) NSString *addressRegion; 63 | 64 | // The encoding. 65 | @property (retain) NSArray *associatedMedia; // of GTLPlusItemScope 66 | 67 | // Number of attendees. 68 | @property (retain) NSNumber *attendeeCount; // intValue 69 | 70 | // A person attending the event. 71 | @property (retain) NSArray *attendees; // of GTLPlusItemScope 72 | 73 | // From http://schema.org/MusicRecording, the audio file. 74 | @property (retain) GTLPlusItemScope *audio; 75 | 76 | // The person or persons who created this result. In the example of restaurant 77 | // reviews, this might be the reviewer's name. 78 | @property (retain) NSArray *author; // of GTLPlusItemScope 79 | 80 | // Best possible rating value that a result might obtain. This property defines 81 | // the upper bound for the ratingValue. For example, you might have a 5 star 82 | // rating scale, you would provide 5 as the value for this property. 83 | @property (copy) NSString *bestRating; 84 | 85 | // Date of birth. 86 | @property (copy) NSString *birthDate; 87 | 88 | // From http://schema.org/MusicRecording, the artist that performed this 89 | // recording. 90 | @property (retain) GTLPlusItemScope *byArtist; 91 | 92 | // The caption for this object. 93 | @property (copy) NSString *caption; 94 | 95 | // File size in (mega/kilo) bytes. 96 | @property (copy) NSString *contentSize; 97 | 98 | // Actual bytes of the media object, for example the image file or video file. 99 | @property (copy) NSString *contentUrl; 100 | 101 | // A list of contributors to this result. 102 | @property (retain) NSArray *contributor; // of GTLPlusItemScope 103 | 104 | // The date the result was created such as the date that a review was first 105 | // created. 106 | @property (copy) NSString *dateCreated; 107 | 108 | // The date the result was last modified such as the date that a review was last 109 | // edited. 110 | @property (copy) NSString *dateModified; 111 | 112 | // The initial date that the result was published. For example, a user writes a 113 | // comment on a blog, which has a result.dateCreated of when they submit it. If 114 | // the blog users comment moderation, the result.datePublished value would match 115 | // the date when the owner approved the message. 116 | @property (copy) NSString *datePublished; 117 | 118 | // The string that describes the content of the result. 119 | // Remapped to 'descriptionProperty' to avoid NSObject's 'description'. 120 | @property (copy) NSString *descriptionProperty; 121 | 122 | // The duration of the item (movie, audio recording, event, etc.) in ISO 8601 123 | // date format. 124 | @property (copy) NSString *duration; 125 | 126 | // A URL pointing to a player for a specific video. In general, this is the 127 | // information in the src element of an embed tag and should not be the same as 128 | // the content of the loc tag. 129 | @property (copy) NSString *embedUrl; 130 | 131 | // The end date and time of the event (in ISO 8601 date format). 132 | @property (copy) NSString *endDate; 133 | 134 | // Family name. This property can be used with givenName instead of the name 135 | // property. 136 | @property (copy) NSString *familyName; 137 | 138 | // Gender of the person. 139 | @property (copy) NSString *gender; 140 | 141 | // Geo coordinates. 142 | @property (retain) GTLPlusItemScope *geo; 143 | 144 | // Given name. This property can be used with familyName instead of the name 145 | // property. 146 | @property (copy) NSString *givenName; 147 | 148 | // The height of the media object. 149 | @property (copy) NSString *height; 150 | 151 | // An identifier for the target. Your app can choose how to identify targets. 152 | // The target.id is required if you are writing an activity that does not have a 153 | // corresponding web page or target.url property. 154 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 155 | @property (copy) NSString *identifier; 156 | 157 | // A URL to the image that represents this result. For example, if a user writes 158 | // a review of a restaurant and attaches a photo of their meal, you might use 159 | // that photo as the result.image. 160 | @property (copy) NSString *image; 161 | 162 | // From http://schema.org/MusicRecording, which album a song is in. 163 | @property (retain) GTLPlusItemScope *inAlbum; 164 | 165 | // Identifies this resource as an itemScope. 166 | @property (copy) NSString *kind; 167 | 168 | // Latitude. 169 | @property (retain) NSNumber *latitude; // doubleValue 170 | 171 | // The location of the event or organization. 172 | @property (retain) GTLPlusItemScope *location; 173 | 174 | // Longitude. 175 | @property (retain) NSNumber *longitude; // doubleValue 176 | 177 | // The name of the result. In the example of a restaurant review, this might be 178 | // the summary the user gave their review such as "Great ambiance, but 179 | // overpriced." 180 | @property (copy) NSString *name; 181 | 182 | // Property of http://schema.org/TVEpisode indicating which series the episode 183 | // belongs to. 184 | @property (retain) GTLPlusItemScope *partOfTVSeries; 185 | 186 | // The main performer or performers of the event-for example, a presenter, 187 | // musician, or actor. 188 | @property (retain) NSArray *performers; // of GTLPlusItemScope 189 | 190 | // Player type that is required. For example: Flash or Silverlight. 191 | @property (copy) NSString *playerType; 192 | 193 | // Postal code. 194 | @property (copy) NSString *postalCode; 195 | 196 | // Post office box number. 197 | @property (copy) NSString *postOfficeBoxNumber; 198 | 199 | // Rating value. 200 | @property (copy) NSString *ratingValue; 201 | 202 | // Review rating. 203 | @property (retain) GTLPlusItemScope *reviewRating; 204 | 205 | // The start date and time of the event (in ISO 8601 date format). 206 | @property (copy) NSString *startDate; 207 | 208 | // Street address. 209 | @property (copy) NSString *streetAddress; 210 | 211 | // The text that is the result of the app activity. For example, if a user 212 | // leaves a review of a restaurant, this might be the text of the review. 213 | @property (copy) NSString *text; 214 | 215 | // Thumbnail image for an image or video. 216 | @property (retain) GTLPlusItemScope *thumbnail; 217 | 218 | // A URL to a thumbnail image that represents this result. 219 | @property (copy) NSString *thumbnailUrl; 220 | 221 | // The exchange traded instrument associated with a Corporation object. The 222 | // tickerSymbol is expressed as an exchange and an instrument name separated by 223 | // a space character. For the exchange component of the tickerSymbol attribute, 224 | // we recommend using the controlled vocabulary of Market Identifier Codes (MIC) 225 | // specified in ISO15022. 226 | @property (copy) NSString *tickerSymbol; 227 | 228 | // The schema.org URL that best describes the referenced target and matches the 229 | // type of moment. 230 | @property (copy) NSString *type; 231 | 232 | // The URL that points to the result object. For example, a permalink directly 233 | // to a restaurant reviewer's comment. 234 | @property (copy) NSString *url; 235 | 236 | // The width of the media object. 237 | @property (copy) NSString *width; 238 | 239 | // Worst possible rating value that a result might obtain. This property defines 240 | // the lower bound for the ratingValue. 241 | @property (copy) NSString *worstRating; 242 | 243 | @end 244 | -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/Headers/GPPSignIn.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPPSignIn.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2012 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | #import 12 | #import 13 | 14 | @class GTLPlusPerson; 15 | @class GTLServicePlus; 16 | @class GTMOAuth2Authentication; 17 | 18 | // A protocol implemented by the client of |GPPSignIn| to receive a refresh 19 | // token or an error. 20 | @protocol GPPSignInDelegate 21 | 22 | // The authorization has finished and is successful if |error| is |nil|. 23 | - (void)finishedWithAuth:(GTMOAuth2Authentication *)auth 24 | error:(NSError *)error; 25 | 26 | // Finished disconnecting user from the app. 27 | // The operation was successful if |error| is |nil|. 28 | @optional 29 | - (void)didDisconnectWithError:(NSError *)error; 30 | 31 | @end 32 | 33 | // This class signs the user in with Google. It also provides single sign-on 34 | // via a capable Google app if one is installed. 35 | // 36 | // For reference, please see "Google+ Sign-In for iOS" at 37 | // https://developers.google.com/+/mobile/ios/sign-in . 38 | // Here is sample code to use |GPPSignIn|: 39 | // 1) Get a reference to the |GPPSignIn| shared instance: 40 | // GPPSignIn *signIn = [GPPSignIn sharedInstance]; 41 | // 2) Set the OAuth 2.0 scopes you want to request: 42 | // [signIn setScopes:[NSArray arrayWithObject: 43 | // @"https://www.googleapis.com/auth/plus.login"]]; 44 | // 2) Call [signIn setDelegate:self]; 45 | // 3) Set up delegate method |finishedWithAuth:error:|. 46 | // 4) Call |handleURL| on the shared instance from |application:openUrl:...| 47 | // in your app delegate. 48 | // 5) Call [signIn authenticate]; 49 | @interface GPPSignIn : NSObject 50 | 51 | // The authentication object for the current user, or |nil| if there is 52 | // currently no logged in user. 53 | @property(nonatomic, strong, readonly) GTMOAuth2Authentication *authentication; 54 | 55 | // A JSON Web Token identifying the user. Send this token to your server to 56 | // authenticate the user on the server. For more information on JWTs, see 57 | // http://tools.ietf.org/html/draft-ietf-oauth-json-web-token-05 58 | @property(nonatomic, strong, readonly) NSString *idToken; 59 | 60 | // The Google user ID. It is only available if |shouldFetchGoogleUserID| is set 61 | // and either |trySilentAuthentication| or |authenticate| has been completed 62 | // successfully. 63 | @property(nonatomic, strong, readonly) NSString *userID; 64 | 65 | // The Google user's email. It is only available if |shouldFetchGoogleUserEmail| 66 | // is set and either |trySilentAuthentication| or |authenticate| has been 67 | // completed successfully. 68 | @property(nonatomic, strong, readonly) NSString *userEmail; 69 | 70 | // The Google+ user profile. It is only available if |shouldFetchGooglePlusUser| 71 | // is set and either |trySilentAuthentication| or |authenticate| has been 72 | // completed successfully. 73 | @property(nonatomic, strong, readonly) GTLPlusPerson *googlePlusUser; 74 | 75 | // The object to be notified when authentication is finished. 76 | @property(nonatomic, weak) id delegate; 77 | 78 | // All properties below are optional parameters. If they need to be set, set 79 | // before calling |authenticate|. 80 | 81 | // The client ID of the app from the Google APIs console. 82 | // Must set for sign-in to work. 83 | @property(nonatomic, copy) NSString *clientID; 84 | 85 | // The client ID of the home web server. This will be returned as the 86 | // |audience| property of the JWT ID token. For more info on the ID token: 87 | // https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo 88 | @property(nonatomic, copy) NSString *homeServerClientID; 89 | 90 | // An OAuth2 authorization code for the home server. 91 | @property(nonatomic, strong, readonly) NSString *homeServerAuthorizationCode; 92 | 93 | // The OpenID2 realm of the home web server. This allows Google to include 94 | // the user's OpenID Identifier in the JWT ID token. 95 | @property(nonatomic, copy) NSString *openIDRealm; 96 | 97 | // The API scopes requested by the app in an array of |NSString|s. 98 | // The default value is |@[@"https://www.googleapis.com/auth/plus.login"]|. 99 | @property(nonatomic, copy) NSArray *scopes; 100 | 101 | // Whether or not to attempt Single-Sign-On when signing in. 102 | // If |attemptSSO| is true, |authenticate| will try to authenticate with 103 | // a capable Google app if one is installed. 104 | @property(nonatomic, assign) BOOL attemptSSO; 105 | 106 | // The language for sign-in, in the form of ISO 639-1 language code 107 | // optionally followed by a dash and ISO 3166-1 alpha-2 region code, 108 | // such as |@"it"| or |@"pt-PT"|. 109 | // Only set if different from system default. 110 | @property(nonatomic, copy) NSString *language; 111 | 112 | // Name of the keychain to save the sign-in state. 113 | // Only set if a custom name needs to be used. 114 | @property(nonatomic, copy) NSString *keychainName; 115 | 116 | // An |NSString| array of moment types used by your app. Use values from the 117 | // full list at 118 | // https://developers.google.com/+/api/moment-types . 119 | // such as "http://schemas.google.com/AddActivity". 120 | // This property is required only for writing moments, with 121 | // "https://www.googleapis.com/auth/plus.login" as a scope. 122 | @property(nonatomic, copy) NSArray *actions; 123 | 124 | // Whether or not to fetch user email after signing in. The email is saved in 125 | // the |GTMOAuth2Authentication| object. Note that using this flag automatically 126 | // adds "https://www.googleapis.com/auth/userinfo.email" scope to the request. 127 | @property(nonatomic, assign) BOOL shouldFetchGoogleUserEmail; 128 | 129 | // Whether or not to fetch user ID after signing in. The ID can be retrieved 130 | // by |googleUserID| after user has been authenticated. Note that using this 131 | // flag automatically adds "https://www.googleapis.com/auth/userinfo.profile" 132 | // scope to the request if a scope that provides user ID is not already present. 133 | @property(nonatomic, assign) BOOL shouldFetchGoogleUserID; 134 | 135 | // Whether or not to fetch Google+ user profile after signing in. The user 136 | // profile object can be retrieved by |googlePlusUser| after user has been 137 | // authenticated. Note that using this flag automatically adds 138 | // "https://www.googleapis.com/auth/plus.me" scope to the request if needed. 139 | @property(nonatomic, assign) BOOL shouldFetchGooglePlusUser; 140 | 141 | // Whether or not the SDK will use the reversed client ID instead of the app's 142 | // bundle ID as the URL scheme, |NO| by default. 143 | // If the flag is |YES|, in addition to register the bundle ID for the URL 144 | // schemes it handles, e.g. "com.MyDomain.MyApp://", the app also needs to 145 | // register the dot-reversed |clientID| for URL scheme, 146 | // e.g. "com.googleusercontent.apps.1234567890-asdfghjkl://". 147 | @property(nonatomic, assign) BOOL useClientIDForURLScheme; 148 | 149 | // Returns a shared |GPPSignIn| instance. 150 | + (GPPSignIn *)sharedInstance; 151 | 152 | // Checks whether the user has either currently signed in or has previous 153 | // authentication saved in keychain. 154 | - (BOOL)hasAuthInKeychain; 155 | 156 | // Attempts to authenticate silently without user interaction. 157 | // Returns |YES| and calls the delegate if the user has either currently signed 158 | // in or has previous authentication saved in keychain. 159 | // Note that if the previous authentication was revoked by the user, this method 160 | // still returns |YES| but |finishedWithAuth:error:| callback will indicate 161 | // that authentication has failed. 162 | - (BOOL)trySilentAuthentication; 163 | 164 | // Starts the authentication process. Set |attemptSSO| to try single sign-on. 165 | // If |attemptSSO| is true, this method also tries to authenticate with a 166 | // capable Google app, if installed. 167 | // The delegate will be called at the end of this process. 168 | // Note that this method should not be called when the app is starting up, 169 | // (e.g in application:didFinishLaunchingWithOptions:). Instead use the 170 | // |trySilentAuthentication| method. 171 | - (void)authenticate; 172 | 173 | // This method should be called from your |UIApplicationDelegate|'s 174 | // |application:openURL:sourceApplication:annotation|. Returns |YES| if 175 | // |GPPSignIn| handled this URL. 176 | // Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|. 177 | - (BOOL)handleURL:(NSURL *)url 178 | sourceApplication:(NSString *)sourceApplication 179 | annotation:(id)annotation; 180 | 181 | // Removes the OAuth 2.0 token from the keychain. 182 | - (void)signOut; 183 | 184 | // Disconnects the user from the app and revokes previous authentication. 185 | // If the operation succeeds, the OAuth 2.0 token is also removed from keychain. 186 | // The token is needed to disconnect so do not call |signOut| if |disconnect| is 187 | // to be called. 188 | - (void)disconnect; 189 | 190 | // Gets a service object authenticated as the current user. The service object 191 | // can execute queries, for example, to get list of people that is visible to 192 | // this app. The user must be signed in for this method to work. 193 | - (GTLServicePlus *)plusService; 194 | 195 | @end 196 | -------------------------------------------------------------------------------- /src/ios/libs/GooglePlus.framework/Versions/A/Headers/GPPShare.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPPShare.h 3 | // Google+ iOS SDK 4 | // 5 | // Copyright 2012 Google Inc. 6 | // 7 | // Use of this SDK is subject to the Google+ Platform Terms of Service: 8 | // https://developers.google.com/+/terms 9 | // 10 | 11 | // To allow a user to share with Google+, please follow these steps: 12 | // 13 | // 0. Create a project on Google API console, 14 | // https://code.google.com/apis/console . Under "API Access", create a 15 | // client ID as "Installed application" with the type "iOS", and 16 | // register the bundle ID of your app. 17 | // 18 | // 1. Initialize the |GPPSignIn| instance with your registered client ID, 19 | // and get the |GPPShare| instance. 20 | // 21 | // [[GPPSignIn shareInstance] setClientID:myClientID]; 22 | // GPPShare *gppShare = [GPPShare sharedInstance]; 23 | // 24 | // 2. In the code where the share dialog will be opened, 25 | // 26 | // [[gppShare shareDialog] open]; 27 | // 28 | // you can optionally call any of the |GPPShareBuilder| methods before 29 | // calling |open|, for example, if there is a particular URL resource to be 30 | // shared, or if you want to set text to prefill user comment in the share 31 | // dialog, such as: 32 | // 33 | // NSURL *urlToShare = [NSURL URLWithString:@"http://www.google.com/"]; 34 | // NSString *prefillText = @"You probably already know this site..."; 35 | // [[[[gppShare shareDialog] setURLToShare:urlToShare] 36 | // setPrefillText:prefillText] open]; 37 | // 38 | // 3. In the '-info.plist' settings for your app, add a URL type to be 39 | // handled by your app. Make the URL scheme the same as your app bundle ID. 40 | // 41 | // 4. In your application delegate, implement: 42 | // - (BOOL)application:(NSString*)application 43 | // openURL:(NSURL *)url 44 | // sourceApplication:(NSString*)sourceApplication 45 | // annotation:(id)annotation { 46 | // if ([gppShare handleURL:url 47 | // sourceApplication:sourceApplication 48 | // annotation:annotation]) { 49 | // return YES; 50 | // } 51 | // // Other handling code here... 52 | // } 53 | // 54 | // 5. Optionally, if you want to be notified of the result of the share action, 55 | // have a delegate class implement |GPPShareDelegate|, for example: 56 | // 57 | // @interface MyDelegateClass : NSObject; 58 | // 59 | // - (void)finishedSharing:(BOOL)shared { 60 | // // The share action was successful if |shared| is YES. 61 | // } 62 | // 63 | // MyDelegateClass *myDelegate = [[MyDelegateClass alloc] init]; 64 | // gppShare.delegate = myDelegate; 65 | 66 | #import 67 | #import 68 | 69 | @class GPPMediaAttachment; 70 | @class GPPSignIn; 71 | 72 | // The error domain for sharing-specific errors. Other error domains might be returned as well. 73 | extern NSString *const kGPPShareErrorDomain; 74 | 75 | // Possible error codes while sharing. These values are for errors of type |kGPPShareErrorDomain|. 76 | enum { 77 | kGPPErrorShareboxCanceled = -401, 78 | kGPPErrorShareboxCanceledByClient = -402, 79 | kGPPErrorShareboxUnknown = -499, 80 | }; 81 | 82 | // The protocol to receive the result of the share action. 83 | @protocol GPPShareDelegate 84 | 85 | @optional 86 | 87 | // Reports the status of the share action. |error| is nil upon success. This callback takes 88 | // preference over |finishedSharing:|. You should implement one of these. 89 | - (void)finishedSharingWithError:(NSError *)error; 90 | 91 | // Reports the status of the share action, |shared| is |YES| if user has successfully shared her 92 | // post, |NO| otherwise, such as if the user canceled the post. This callback is superseded by 93 | // |finishedSharingWithError:|. You should implement one of these. 94 | - (void)finishedSharing:(BOOL)shared; 95 | 96 | @end 97 | 98 | // The builder protocol to open the share dialog. 99 | // For more information on sharing, see 100 | // http://developers.google.com/+/mobile/ios/share . 101 | @protocol GPPShareBuilder 102 | 103 | // Sets the URL resource to be shared. 104 | - (id)setURLToShare:(NSURL *)urlToShare; 105 | 106 | // Sets the text to prefill user's comment in the share dialog. 107 | - (id)setPrefillText:(NSString *)prefillText; 108 | 109 | // Sets the title, description, and thumbnail URL of the shared content preview 110 | // in the share dialog. Only set these fields if you are sharing with a content 111 | // deep link and don't have a URL resource. |title| is required. 112 | - (id)setTitle:(NSString *)title 113 | description:(NSString *)description 114 | thumbnailURL:(NSURL *)thumbnailURL; 115 | 116 | // Sets the content deep-link ID that takes the user straight to your shared 117 | // content. Only set this field if you want the content deep-linking feature. 118 | // The content deep-link ID can either be a fully qualified URI, or URI path, 119 | // which can be up to 512 characters in length. 120 | - (id)setContentDeepLinkID:(NSString *)contentDeepLinkID; 121 | 122 | // Sets the call-to-action button of the shared content preview. 123 | // The call-to-action button consists of a label, URL, and deep-link ID. 124 | // The |label| is a string key defined under "data-calltoactionlabel" on 125 | // http://developers.google.com/+/web/share/interactive#button_attr_calltoactionlabel 126 | // that maps to the actual button text. 127 | // The |url| is where the user is taken to after tapping on the button. 128 | // The optional |deepLinkID| is the call-to-action deep-link ID that takes the 129 | // user straight to a specific action in your app. It can either be a fully 130 | // qualified URI, or URI path, which can be up to 512 characters in length. 131 | // Note: In order to set the call-to-action button: 132 | // 1. User must have been authenticated with scopes including 133 | // "https://www.googleapis.com/auth/plus.login". 134 | // 2. |setURLToShare:| must also be called. 135 | - (id)setCallToActionButtonWithLabel:(NSString *)label 136 | URL:(NSURL *)url 137 | deepLinkID:(NSString *)deepLinkID; 138 | 139 | // Opens the share dialog. Returns |NO| if there was an error, |YES| otherwise. 140 | - (BOOL)open; 141 | 142 | @end 143 | 144 | // The builder protocol that is specific to the native sharebox. 145 | @protocol GPPNativeShareBuilder 146 | 147 | // Attaches an image to be shared. If there is an existing media attachment, it is replaced. 148 | // If |imageAttachment| is nil, this method does nothing and returns nil. 149 | // This method cannot be called in combination with either |setURLToShare:| or 150 | // |setTitle:description:thumbnailURL:|. 151 | - (id)attachImage:(UIImage *)imageAttachment; 152 | 153 | // Attaches an image to be shared, created from @param |imageData|. This should be used only if 154 | // there is metadata attached to the image that should be preserved. If there is an existing media 155 | // attachment, it is replaced. If @param |imageData| is nil, return nil. This method cannot be 156 | // called in combination with either |setURLToShare:| or |setTitle:description:thumbnailURL:|. 157 | - (id)attachImageData:(NSData *)imageData; 158 | 159 | // Attaches a video to be shared. If there is an existing media attachment, it is replaced. 160 | // The video URL should be a local URL referencing a file on the device. If the URL is invalid, 161 | // this method does nothing and returns nil. 162 | // This method cannot be called in combination with either |setURLToShare:| or 163 | // |setTitle:description:thumbnailURL:|. 164 | - (id)attachVideoURL:(NSURL *)videoAttachment; 165 | 166 | // Pre-selects people for the post audience. |peopleIDs| is an array of |NSString| objects 167 | // representing IDs of selected people in the post. 168 | // At least 1 person and at most 10 people can be pre-selected if this method is called. 169 | - (id)setPreselectedPeopleIDs:(NSArray *)preselectedPeopleIDs; 170 | 171 | @end 172 | 173 | // The primary class for the share action on Google+. 174 | // For more information on sharing, see 175 | // http://developers.google.com/+/mobile/ios/share . 176 | @interface GPPShare : NSObject 177 | 178 | // The object to be notified when the share action has finished. 179 | @property(nonatomic, weak) NSObject *delegate; 180 | 181 | // Returns a shared |GPPShare| instance. 182 | // |[GPPSignIn sharedInstance].clientID| must be initialized with a client ID 183 | // registered in the Google API console, https://code.google.com/apis/console/ 184 | // with the app's bundle ID. 185 | + (GPPShare *)sharedInstance; 186 | 187 | // Returns a share dialog builder instance. Call its |open| method to 188 | // create the dialog after setting the parameters as needed. 189 | - (id)shareDialog; 190 | 191 | // Returns a native share dialog builder instance. Call its |open| method to 192 | // create the dialog after setting the parameters as needed. 193 | // Before the native share dialog can be opened, the user must have consented to the OAuth2 scope 194 | // "https://www.googleapis.com/auth/plus.login". 195 | - (id)nativeShareDialog; 196 | 197 | // Closes the active native share dialog immediately, if one exists. 198 | // Note that it is usually not necessary to call this method, as the sharebox closes itself 199 | // once the share action has completed either successfully or with an error. Only call this method 200 | // when you need to permanently interrupt the user in the middle of sharing, because whatever the 201 | // user entered will be lost. 202 | - (void)closeActiveNativeShareDialog; 203 | 204 | // This method should be called from your |UIApplicationDelegate|'s 205 | // |application:openURL:sourceApplication:annotation|. Returns |YES| if 206 | // |GPPShare| handled this URL. 207 | // Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|. 208 | - (BOOL)handleURL:(NSURL *)url 209 | sourceApplication:(NSString *)sourceApplication 210 | annotation:(id)annotation; 211 | 212 | @end 213 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTLQueryPlus.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // 17 | // GTLQueryPlus.h 18 | // 19 | 20 | // ---------------------------------------------------------------------------- 21 | // NOTE: This file is generated from Google APIs Discovery Service. 22 | // Service: 23 | // Google+ API (plus/v1) 24 | // Description: 25 | // The Google+ API enables developers to build on top of the Google+ platform. 26 | // Documentation: 27 | // https://developers.google.com/+/api/ 28 | // Classes: 29 | // GTLQueryPlus (12 custom class methods, 15 custom properties) 30 | 31 | #if GTL_BUILT_AS_FRAMEWORK 32 | #import "GTL/GTLQuery.h" 33 | #else 34 | #import "GTLQuery.h" 35 | #endif 36 | 37 | @class GTLPlusMoment; 38 | 39 | @interface GTLQueryPlus : GTLQuery 40 | 41 | // 42 | // Parameters valid on all methods. 43 | // 44 | 45 | // Selector specifying which fields to include in a partial response. 46 | @property (copy) NSString *fields; 47 | 48 | // 49 | // Method-specific parameters; see the comments below for more information. 50 | // 51 | @property (copy) NSString *activityId; 52 | @property (copy) NSString *collection; 53 | @property (copy) NSString *commentId; 54 | @property (assign) BOOL debug; 55 | // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). 56 | @property (copy) NSString *identifier; 57 | @property (copy) NSString *language; 58 | @property (assign) NSUInteger maxResults; 59 | @property (copy) NSString *orderBy; 60 | @property (copy) NSString *pageToken; 61 | @property (copy) NSString *query; 62 | @property (copy) NSString *sortOrder; 63 | @property (copy) NSString *targetUrl; 64 | @property (copy) NSString *type; 65 | @property (copy) NSString *userId; 66 | 67 | #pragma mark - 68 | #pragma mark "activities" methods 69 | // These create a GTLQueryPlus object. 70 | 71 | // Method: plus.activities.get 72 | // Get an activity. 73 | // Required: 74 | // activityId: The ID of the activity to get. 75 | // Authorization scope(s): 76 | // kGTLAuthScopePlusLogin 77 | // kGTLAuthScopePlusMe 78 | // Fetches a GTLPlusActivity. 79 | + (id)queryForActivitiesGetWithActivityId:(NSString *)activityId; 80 | 81 | // Method: plus.activities.list 82 | // List all of the activities in the specified collection for a particular user. 83 | // Required: 84 | // userId: The ID of the user to get activities for. The special value "me" 85 | // can be used to indicate the authenticated user. 86 | // collection: The collection of activities to list. 87 | // kGTLPlusCollectionPublic: All public activities created by the specified 88 | // user. 89 | // Optional: 90 | // maxResults: The maximum number of activities to include in the response, 91 | // which is used for paging. For any response, the actual number returned 92 | // might be less than the specified maxResults. (1..100, default 20) 93 | // pageToken: The continuation token, which is used to page through large 94 | // result sets. To get the next page of results, set this parameter to the 95 | // value of "nextPageToken" from the previous response. 96 | // Authorization scope(s): 97 | // kGTLAuthScopePlusLogin 98 | // kGTLAuthScopePlusMe 99 | // Fetches a GTLPlusActivityFeed. 100 | + (id)queryForActivitiesListWithUserId:(NSString *)userId 101 | collection:(NSString *)collection; 102 | 103 | // Method: plus.activities.search 104 | // Search public activities. 105 | // Required: 106 | // query: Full-text search query string. 107 | // Optional: 108 | // language: Specify the preferred language to search with. See search 109 | // language codes for available values. (Default en-US) 110 | // maxResults: The maximum number of activities to include in the response, 111 | // which is used for paging. For any response, the actual number returned 112 | // might be less than the specified maxResults. (1..20, default 10) 113 | // orderBy: Specifies how to order search results. (Default 114 | // kGTLPlusOrderByRecent) 115 | // kGTLPlusOrderByBest: Sort activities by relevance to the user, most 116 | // relevant first. 117 | // kGTLPlusOrderByRecent: Sort activities by published date, most recent 118 | // first. 119 | // pageToken: The continuation token, which is used to page through large 120 | // result sets. To get the next page of results, set this parameter to the 121 | // value of "nextPageToken" from the previous response. This token can be of 122 | // any length. 123 | // Authorization scope(s): 124 | // kGTLAuthScopePlusLogin 125 | // kGTLAuthScopePlusMe 126 | // Fetches a GTLPlusActivityFeed. 127 | + (id)queryForActivitiesSearchWithQuery:(NSString *)query; 128 | 129 | #pragma mark - 130 | #pragma mark "comments" methods 131 | // These create a GTLQueryPlus object. 132 | 133 | // Method: plus.comments.get 134 | // Get a comment. 135 | // Required: 136 | // commentId: The ID of the comment to get. 137 | // Authorization scope(s): 138 | // kGTLAuthScopePlusLogin 139 | // kGTLAuthScopePlusMe 140 | // Fetches a GTLPlusComment. 141 | + (id)queryForCommentsGetWithCommentId:(NSString *)commentId; 142 | 143 | // Method: plus.comments.list 144 | // List all of the comments for an activity. 145 | // Required: 146 | // activityId: The ID of the activity to get comments for. 147 | // Optional: 148 | // maxResults: The maximum number of comments to include in the response, 149 | // which is used for paging. For any response, the actual number returned 150 | // might be less than the specified maxResults. (0..500, default 20) 151 | // pageToken: The continuation token, which is used to page through large 152 | // result sets. To get the next page of results, set this parameter to the 153 | // value of "nextPageToken" from the previous response. 154 | // sortOrder: The order in which to sort the list of comments. (Default 155 | // kGTLPlusSortOrderAscending) 156 | // kGTLPlusSortOrderAscending: Sort oldest comments first. 157 | // kGTLPlusSortOrderDescending: Sort newest comments first. 158 | // Authorization scope(s): 159 | // kGTLAuthScopePlusLogin 160 | // kGTLAuthScopePlusMe 161 | // Fetches a GTLPlusCommentFeed. 162 | + (id)queryForCommentsListWithActivityId:(NSString *)activityId; 163 | 164 | #pragma mark - 165 | #pragma mark "moments" methods 166 | // These create a GTLQueryPlus object. 167 | 168 | // Method: plus.moments.insert 169 | // Record a moment representing a user's activity such as making a purchase or 170 | // commenting on a blog. 171 | // Required: 172 | // userId: The ID of the user to record activities for. The only valid values 173 | // are "me" and the ID of the authenticated user. 174 | // collection: The collection to which to write moments. 175 | // kGTLPlusCollectionVault: The default collection for writing new moments. 176 | // Optional: 177 | // debug: Return the moment as written. Should be used only for debugging. 178 | // Authorization scope(s): 179 | // kGTLAuthScopePlusLogin 180 | // kGTLAuthScopePlusMe 181 | // Fetches a GTLPlusMoment. 182 | + (id)queryForMomentsInsertWithObject:(GTLPlusMoment *)object 183 | userId:(NSString *)userId 184 | collection:(NSString *)collection; 185 | 186 | // Method: plus.moments.list 187 | // List all of the moments for a particular user. 188 | // Required: 189 | // userId: The ID of the user to get moments for. The special value "me" can 190 | // be used to indicate the authenticated user. 191 | // collection: The collection of moments to list. 192 | // kGTLPlusCollectionVault: All moments created by the requesting 193 | // application for the authenticated user. 194 | // Optional: 195 | // maxResults: The maximum number of moments to include in the response, which 196 | // is used for paging. For any response, the actual number returned might be 197 | // less than the specified maxResults. (1..100, default 20) 198 | // pageToken: The continuation token, which is used to page through large 199 | // result sets. To get the next page of results, set this parameter to the 200 | // value of "nextPageToken" from the previous response. 201 | // targetUrl: Only moments containing this targetUrl will be returned. 202 | // type: Only moments of this type will be returned. 203 | // Authorization scope(s): 204 | // kGTLAuthScopePlusLogin 205 | // kGTLAuthScopePlusMe 206 | // Fetches a GTLPlusMomentsFeed. 207 | + (id)queryForMomentsListWithUserId:(NSString *)userId 208 | collection:(NSString *)collection; 209 | 210 | // Method: plus.moments.remove 211 | // Delete a moment. 212 | // Required: 213 | // identifier: The ID of the moment to delete. 214 | // Authorization scope(s): 215 | // kGTLAuthScopePlusLogin 216 | + (id)queryForMomentsRemoveWithIdentifier:(NSString *)identifier; 217 | 218 | #pragma mark - 219 | #pragma mark "people" methods 220 | // These create a GTLQueryPlus object. 221 | 222 | // Method: plus.people.get 223 | // Get a person's profile. If your app uses scope 224 | // https://www.googleapis.com/auth/plus.login, this method is guaranteed to 225 | // return ageRange and language. 226 | // Required: 227 | // userId: The ID of the person to get the profile for. The special value "me" 228 | // can be used to indicate the authenticated user. 229 | // Authorization scope(s): 230 | // kGTLAuthScopePlusLogin 231 | // kGTLAuthScopePlusMe 232 | // kGTLAuthScopePlusUserinfoEmail 233 | // kGTLAuthScopePlusUserinfoProfile 234 | // Fetches a GTLPlusPerson. 235 | + (id)queryForPeopleGetWithUserId:(NSString *)userId; 236 | 237 | // Method: plus.people.list 238 | // List all of the people in the specified collection. 239 | // Required: 240 | // userId: Get the collection of people for the person identified. Use "me" to 241 | // indicate the authenticated user. 242 | // collection: The collection of people to list. 243 | // kGTLPlusCollectionConnected: The list of visible people in the 244 | // authenticated user's circles who also use the requesting app. This 245 | // list is limited to users who made their app activities visible to the 246 | // authenticated user. 247 | // kGTLPlusCollectionVisible: The list of people who this user has added to 248 | // one or more circles, limited to the circles visible to the requesting 249 | // application. 250 | // Optional: 251 | // maxResults: The maximum number of people to include in the response, which 252 | // is used for paging. For any response, the actual number returned might be 253 | // less than the specified maxResults. (1..100, default 100) 254 | // orderBy: The order to return people in. 255 | // kGTLPlusOrderByAlphabetical: Order the people by their display name. 256 | // kGTLPlusOrderByBest: Order people based on the relevence to the viewer. 257 | // pageToken: The continuation token, which is used to page through large 258 | // result sets. To get the next page of results, set this parameter to the 259 | // value of "nextPageToken" from the previous response. 260 | // Authorization scope(s): 261 | // kGTLAuthScopePlusLogin 262 | // kGTLAuthScopePlusMe 263 | // Fetches a GTLPlusPeopleFeed. 264 | + (id)queryForPeopleListWithUserId:(NSString *)userId 265 | collection:(NSString *)collection; 266 | 267 | // Method: plus.people.listByActivity 268 | // List all of the people in the specified collection for a particular activity. 269 | // Required: 270 | // activityId: The ID of the activity to get the list of people for. 271 | // collection: The collection of people to list. 272 | // kGTLPlusCollectionPlusoners: List all people who have +1'd this 273 | // activity. 274 | // kGTLPlusCollectionResharers: List all people who have reshared this 275 | // activity. 276 | // Optional: 277 | // maxResults: The maximum number of people to include in the response, which 278 | // is used for paging. For any response, the actual number returned might be 279 | // less than the specified maxResults. (1..100, default 20) 280 | // pageToken: The continuation token, which is used to page through large 281 | // result sets. To get the next page of results, set this parameter to the 282 | // value of "nextPageToken" from the previous response. 283 | // Authorization scope(s): 284 | // kGTLAuthScopePlusLogin 285 | // kGTLAuthScopePlusMe 286 | // Fetches a GTLPlusPeopleFeed. 287 | + (id)queryForPeopleListByActivityWithActivityId:(NSString *)activityId 288 | collection:(NSString *)collection; 289 | 290 | // Method: plus.people.search 291 | // Search all public profiles. 292 | // Required: 293 | // query: Specify a query string for full text search of public text in all 294 | // profiles. 295 | // Optional: 296 | // language: Specify the preferred language to search with. See search 297 | // language codes for available values. (Default en-US) 298 | // maxResults: The maximum number of people to include in the response, which 299 | // is used for paging. For any response, the actual number returned might be 300 | // less than the specified maxResults. (1..50, default 25) 301 | // pageToken: The continuation token, which is used to page through large 302 | // result sets. To get the next page of results, set this parameter to the 303 | // value of "nextPageToken" from the previous response. This token can be of 304 | // any length. 305 | // Authorization scope(s): 306 | // kGTLAuthScopePlusLogin 307 | // kGTLAuthScopePlusMe 308 | // Fetches a GTLPlusPeopleFeed. 309 | + (id)queryForPeopleSearchWithQuery:(NSString *)query; 310 | 311 | @end 312 | -------------------------------------------------------------------------------- /src/ios/libs/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2Authentication.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES 17 | 18 | // This class implements the OAuth 2 protocol for authorizing requests. 19 | // http://tools.ietf.org/html/draft-ietf-oauth-v2 20 | 21 | #import 22 | 23 | // GTMHTTPFetcher.h brings in GTLDefines/GDataDefines 24 | #import "GTMHTTPFetcher.h" 25 | 26 | // Until all OAuth 2 providers are up to the same spec, we'll provide a crude 27 | // way here to override the "Bearer" string in the Authorization header 28 | #ifndef GTM_OAUTH2_BEARER 29 | #define GTM_OAUTH2_BEARER "Bearer" 30 | #endif 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | // Service provider name allows stored authorization to be associated with 37 | // the authorizing service 38 | extern NSString *const kGTMOAuth2ServiceProviderGoogle; 39 | 40 | // 41 | // GTMOAuth2SignIn constants, included here for use by clients 42 | // 43 | extern NSString *const kGTMOAuth2ErrorDomain; 44 | 45 | // Error userInfo keys 46 | extern NSString *const kGTMOAuth2ErrorMessageKey; 47 | extern NSString *const kGTMOAuth2ErrorRequestKey; 48 | extern NSString *const kGTMOAuth2ErrorJSONKey; 49 | 50 | enum { 51 | // Error code indicating that the window was prematurely closed 52 | kGTMOAuth2ErrorWindowClosed = -1000, 53 | kGTMOAuth2ErrorAuthorizationFailed = -1001, 54 | kGTMOAuth2ErrorTokenExpired = -1002, 55 | kGTMOAuth2ErrorTokenUnavailable = -1003, 56 | kGTMOAuth2ErrorUnauthorizableRequest = -1004 57 | }; 58 | 59 | 60 | // Notifications for token fetches 61 | extern NSString *const kGTMOAuth2FetchStarted; 62 | extern NSString *const kGTMOAuth2FetchStopped; 63 | 64 | extern NSString *const kGTMOAuth2FetcherKey; 65 | extern NSString *const kGTMOAuth2FetchTypeKey; 66 | extern NSString *const kGTMOAuth2FetchTypeToken; 67 | extern NSString *const kGTMOAuth2FetchTypeRefresh; 68 | extern NSString *const kGTMOAuth2FetchTypeAssertion; 69 | extern NSString *const kGTMOAuth2FetchTypeUserInfo; 70 | 71 | // Token-issuance errors 72 | extern NSString *const kGTMOAuth2ErrorKey; 73 | extern NSString *const kGTMOAuth2ErrorObjectKey; 74 | 75 | extern NSString *const kGTMOAuth2ErrorInvalidRequest; 76 | extern NSString *const kGTMOAuth2ErrorInvalidClient; 77 | extern NSString *const kGTMOAuth2ErrorInvalidGrant; 78 | extern NSString *const kGTMOAuth2ErrorUnauthorizedClient; 79 | extern NSString *const kGTMOAuth2ErrorUnsupportedGrantType; 80 | extern NSString *const kGTMOAuth2ErrorInvalidScope; 81 | 82 | // Notification that sign-in has completed, and token fetches will begin (useful 83 | // for displaying interstitial messages after the window has closed) 84 | extern NSString *const kGTMOAuth2UserSignedIn; 85 | 86 | // Notification for token changes 87 | extern NSString *const kGTMOAuth2AccessTokenRefreshed; 88 | extern NSString *const kGTMOAuth2RefreshTokenChanged; 89 | extern NSString *const kGTMOAuth2AccessTokenRefreshFailed; 90 | 91 | // Notification for WebView loading 92 | extern NSString *const kGTMOAuth2WebViewStartedLoading; 93 | extern NSString *const kGTMOAuth2WebViewStoppedLoading; 94 | extern NSString *const kGTMOAuth2WebViewKey; 95 | extern NSString *const kGTMOAuth2WebViewStopKindKey; 96 | extern NSString *const kGTMOAuth2WebViewFinished; 97 | extern NSString *const kGTMOAuth2WebViewFailed; 98 | extern NSString *const kGTMOAuth2WebViewCancelled; 99 | 100 | // Notification for network loss during html sign-in display 101 | extern NSString *const kGTMOAuth2NetworkLost; 102 | extern NSString *const kGTMOAuth2NetworkFound; 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | @interface GTMOAuth2Authentication : NSObject { 109 | @private 110 | NSString *clientID_; 111 | NSString *clientSecret_; 112 | NSString *redirectURI_; 113 | NSMutableDictionary *parameters_; 114 | 115 | // authorization parameters 116 | NSURL *tokenURL_; 117 | NSDate *expirationDate_; 118 | 119 | NSString *authorizationTokenKey_; 120 | 121 | NSDictionary *additionalTokenRequestParameters_; 122 | NSDictionary *additionalGrantTypeRequestParameters_; 123 | 124 | // queue of requests for authorization waiting for a valid access token 125 | GTMHTTPFetcher *refreshFetcher_; 126 | NSMutableArray *authorizationQueue_; 127 | 128 | id fetcherService_; // WEAK 129 | 130 | Class parserClass_; 131 | 132 | BOOL shouldAuthorizeAllRequests_; 133 | 134 | // arbitrary data retained for the user 135 | id userData_; 136 | NSMutableDictionary *properties_; 137 | } 138 | 139 | // OAuth2 standard protocol parameters 140 | // 141 | // These should be the plain strings; any needed escaping will be provided by 142 | // the library. 143 | 144 | // Request properties 145 | @property (copy) NSString *clientID; 146 | @property (copy) NSString *clientSecret; 147 | @property (copy) NSString *redirectURI; 148 | @property (retain) NSString *scope; 149 | @property (retain) NSString *tokenType; 150 | @property (retain) NSString *assertion; 151 | @property (retain) NSString *refreshScope; 152 | 153 | // Apps may optionally add parameters here to be provided to the token 154 | // endpoint on token requests and refreshes. 155 | @property (retain) NSDictionary *additionalTokenRequestParameters; 156 | 157 | // Apps may optionally add parameters here to be provided to the token 158 | // endpoint on specific token requests and refreshes, keyed by the grant_type. 159 | // For example, if a different "type" parameter is required for obtaining 160 | // the auth code and on refresh, this might be: 161 | // 162 | // viewController.authentication.additionalGrantTypeRequestParameters = @{ 163 | // @"authorization_code" : @{ @"type" : @"code" }, 164 | // @"refresh_token" : @{ @"type" : @"refresh" } 165 | // }; 166 | @property (retain) NSDictionary *additionalGrantTypeRequestParameters; 167 | 168 | // Response properties 169 | @property (retain) NSMutableDictionary *parameters; 170 | 171 | @property (retain) NSString *accessToken; 172 | @property (retain) NSString *refreshToken; 173 | @property (retain) NSNumber *expiresIn; 174 | @property (retain) NSString *code; 175 | @property (retain) NSString *errorString; 176 | 177 | // URL for obtaining access tokens 178 | @property (copy) NSURL *tokenURL; 179 | 180 | // Calculated expiration date (expiresIn seconds added to the 181 | // time the access token was received.) 182 | @property (copy) NSDate *expirationDate; 183 | 184 | // Service identifier, like "Google"; not used for authentication 185 | // 186 | // The provider name is just for allowing stored authorization to be associated 187 | // with the authorizing service. 188 | @property (copy) NSString *serviceProvider; 189 | 190 | // User ID; not used for authentication 191 | @property (retain) NSString *userID; 192 | 193 | // User email and verified status; not used for authentication 194 | // 195 | // The verified string can be checked with -boolValue. If the result is false, 196 | // then the email address is listed with the account on the server, but the 197 | // address has not been confirmed as belonging to the owner of the account. 198 | @property (retain) NSString *userEmail; 199 | @property (retain) NSString *userEmailIsVerified; 200 | 201 | // Property indicating if this auth has a refresh or access token so is suitable 202 | // for authorizing a request. This does not guarantee that the token is valid. 203 | @property (readonly) BOOL canAuthorize; 204 | 205 | // Property indicating if this object will authorize plain http request 206 | // (as well as any non-https requests.) Default is NO, only requests with the 207 | // scheme https are authorized, since security may be compromised if tokens 208 | // are sent over the wire using an unencrypted protocol like http. 209 | @property (assign) BOOL shouldAuthorizeAllRequests; 210 | 211 | // userData is retained for the convenience of the caller 212 | @property (retain) id userData; 213 | 214 | // Stored property values are retained for the convenience of the caller 215 | @property (retain) NSDictionary *properties; 216 | 217 | // Property for the optional fetcher service instance to be used to create 218 | // fetchers 219 | // 220 | // Fetcher service objects retain authorizations, so this is weak to avoid 221 | // circular retains. 222 | @property (assign) id fetcherService; // WEAK 223 | 224 | // Alternative JSON parsing class; this should implement the 225 | // GTMOAuth2ParserClass informal protocol. If this property is 226 | // not set, the class SBJSON must be available in the runtime. 227 | @property (assign) Class parserClass; 228 | 229 | // Key for the response parameter used for the authorization header; by default, 230 | // "access_token" is used, but some servers may expect alternatives, like 231 | // "id_token". 232 | @property (copy) NSString *authorizationTokenKey; 233 | 234 | // Convenience method for creating an authentication object 235 | + (id)authenticationWithServiceProvider:(NSString *)serviceProvider 236 | tokenURL:(NSURL *)tokenURL 237 | redirectURI:(NSString *)redirectURI 238 | clientID:(NSString *)clientID 239 | clientSecret:(NSString *)clientSecret; 240 | 241 | // Clear out any authentication values, prepare for a new request fetch 242 | - (void)reset; 243 | 244 | // Main authorization entry points 245 | // 246 | // These will refresh the access token, if necessary, add the access token to 247 | // the request, then invoke the callback. 248 | // 249 | // The request argument may be nil to just force a refresh of the access token, 250 | // if needed. 251 | // 252 | // NOTE: To avoid accidental leaks of bearer tokens, the request must 253 | // be for a URL with the scheme https unless the shouldAuthorizeAllRequests 254 | // property is set. 255 | 256 | // The finish selector should have a signature matching 257 | // - (void)authentication:(GTMOAuth2Authentication *)auth 258 | // request:(NSMutableURLRequest *)request 259 | // finishedWithError:(NSError *)error; 260 | 261 | - (void)authorizeRequest:(NSMutableURLRequest *)request 262 | delegate:(id)delegate 263 | didFinishSelector:(SEL)sel; 264 | 265 | #if NS_BLOCKS_AVAILABLE 266 | - (void)authorizeRequest:(NSMutableURLRequest *)request 267 | completionHandler:(void (^)(NSError *error))handler; 268 | #endif 269 | 270 | // Synchronous entry point; authorizing this way cannot refresh an expired 271 | // access token 272 | - (BOOL)authorizeRequest:(NSMutableURLRequest *)request; 273 | 274 | // If the authentication is waiting for a refresh to complete, spin the run 275 | // loop, discarding events, until the fetch has completed 276 | // 277 | // This is only for use in testing or in tools without a user interface. 278 | - (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds; 279 | 280 | 281 | ////////////////////////////////////////////////////////////////////////////// 282 | // 283 | // Internal properties and methods for use by GTMOAuth2SignIn 284 | // 285 | 286 | // Pending fetcher to get a new access token, if any 287 | @property (retain) GTMHTTPFetcher *refreshFetcher; 288 | 289 | // Check if a request is queued up to be authorized 290 | - (BOOL)isAuthorizingRequest:(NSURLRequest *)request; 291 | 292 | // Check if a request appears to be authorized 293 | - (BOOL)isAuthorizedRequest:(NSURLRequest *)request; 294 | 295 | // Stop any pending refresh fetch. This will also cancel the authorization 296 | // for all fetch requests pending authorization. 297 | - (void)stopAuthorization; 298 | 299 | // Prevents authorization callback for a given request. 300 | - (void)stopAuthorizationForRequest:(NSURLRequest *)request; 301 | 302 | // OAuth fetch user-agent header value 303 | - (NSString *)userAgent; 304 | 305 | // Parse and set token and token secret from response data 306 | - (void)setKeysForResponseString:(NSString *)str; 307 | - (void)setKeysForResponseDictionary:(NSDictionary *)dict; 308 | 309 | // Persistent token string for keychain storage 310 | // 311 | // We'll use the format "refresh_token=foo&serviceProvider=bar" so we can 312 | // easily alter what portions of the auth data are stored 313 | // 314 | // Use these methods for serialization 315 | - (NSString *)persistenceResponseString; 316 | - (void)setKeysForPersistenceResponseString:(NSString *)str; 317 | 318 | // method to begin fetching an access token, used by the sign-in object 319 | - (GTMHTTPFetcher *)beginTokenFetchWithDelegate:(id)delegate 320 | didFinishSelector:(SEL)finishedSel; 321 | 322 | // Entry point to post a notification about a fetcher currently used for 323 | // obtaining or refreshing a token; the sign-in object will also use this 324 | // to indicate when the user's email address is being fetched. 325 | // 326 | // Fetch type constants are above under "notifications for token fetches" 327 | - (void)notifyFetchIsRunning:(BOOL)isStarting 328 | fetcher:(GTMHTTPFetcher *)fetcher 329 | type:(NSString *)fetchType; 330 | 331 | // Arbitrary key-value properties retained for the user 332 | - (void)setProperty:(id)obj forKey:(NSString *)key; 333 | - (id)propertyForKey:(NSString *)key; 334 | 335 | // 336 | // Utilities 337 | // 338 | 339 | + (NSString *)encodedOAuthValueForString:(NSString *)str; 340 | 341 | + (NSString *)encodedQueryParametersForDictionary:(NSDictionary *)dict; 342 | 343 | + (NSDictionary *)dictionaryWithResponseString:(NSString *)responseStr; 344 | 345 | + (NSDictionary *)dictionaryWithJSONData:(NSData *)data; 346 | 347 | + (NSString *)scopeWithStrings:(NSString *)firstStr, ... NS_REQUIRES_NIL_TERMINATION; 348 | @end 349 | 350 | #endif // GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES 351 | --------------------------------------------------------------------------------