Update Google+ integration.
[UPDATED] Google+ SDK to 1.1.0.
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
D973B402158ABC1F0083A4B5 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D973B401158ABC1F0083A4B5 /* MessageUI.framework */; };
|
||||
D98254A815990D8D0060CA47 /* Icon_2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D98254A615990D8D0060CA47 /* Icon_2x.png */; };
|
||||
D98254A915990D8D0060CA47 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = D98254A715990D8D0060CA47 /* Icon.png */; };
|
||||
D98254F2159937730060CA47 /* GTLPlusPerson.m in Sources */ = {isa = PBXBuildFile; fileRef = D98254F1159937730060CA47 /* GTLPlusPerson.m */; };
|
||||
D9EE743D158A8BD400EC1D05 /* google_plus_share_large.png in Resources */ = {isa = PBXBuildFile; fileRef = D9EE7435158A8BD400EC1D05 /* google_plus_share_large.png */; };
|
||||
D9EE743E158A8BD400EC1D05 /* google_plus_share_large@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D9EE7436158A8BD400EC1D05 /* google_plus_share_large@2x.png */; };
|
||||
D9EE743F158A8BD400EC1D05 /* google_plus_share.png in Resources */ = {isa = PBXBuildFile; fileRef = D9EE7437158A8BD400EC1D05 /* google_plus_share.png */; };
|
||||
@@ -79,14 +78,13 @@
|
||||
00F70E98158007D90077799E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
00F70E9A158008040077799E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
0C52D6F7158BAB1F001510E6 /* button_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = button_background.png; path = Resources/button_background.png; sourceTree = SOURCE_ROOT; };
|
||||
294FD685163B67F500A9D5CA /* GPPDeepLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPPDeepLink.h; path = ../lib/GPPDeepLink.h; sourceTree = "<group>"; };
|
||||
D973B401158ABC1F0083A4B5 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
|
||||
D98254A615990D8D0060CA47 /* Icon_2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_2x.png; path = Resources/Icon_2x.png; sourceTree = SOURCE_ROOT; };
|
||||
D98254A715990D8D0060CA47 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Resources/Icon.png; sourceTree = SOURCE_ROOT; };
|
||||
D98254F0159937730060CA47 /* GTLPlusPerson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTLPlusPerson.h; sourceTree = "<group>"; };
|
||||
D98254F1159937730060CA47 /* GTLPlusPerson.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTLPlusPerson.m; sourceTree = "<group>"; };
|
||||
D9EE7431158A8BAE00EC1D05 /* GooglePlusShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GooglePlusShare.h; path = ../lib/GooglePlusShare.h; sourceTree = "<group>"; };
|
||||
D9EE7432158A8BAE00EC1D05 /* GooglePlusSignIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GooglePlusSignIn.h; path = ../lib/GooglePlusSignIn.h; sourceTree = "<group>"; };
|
||||
D9EE7433158A8BAE00EC1D05 /* GooglePlusSignInButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GooglePlusSignInButton.h; path = ../lib/GooglePlusSignInButton.h; sourceTree = "<group>"; };
|
||||
D9EE7431158A8BAE00EC1D05 /* GPPShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPPShare.h; path = ../lib/GPPShare.h; sourceTree = "<group>"; };
|
||||
D9EE7432158A8BAE00EC1D05 /* GPPSignIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPPSignIn.h; path = ../lib/GPPSignIn.h; sourceTree = "<group>"; };
|
||||
D9EE7433158A8BAE00EC1D05 /* GPPSignInButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPPSignInButton.h; path = ../lib/GPPSignInButton.h; sourceTree = "<group>"; };
|
||||
D9EE7435158A8BD400EC1D05 /* google_plus_share_large.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = google_plus_share_large.png; path = ../Resources/google_plus_share_large.png; sourceTree = "<group>"; };
|
||||
D9EE7436158A8BD400EC1D05 /* google_plus_share_large@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "google_plus_share_large@2x.png"; path = "../Resources/google_plus_share_large@2x.png"; sourceTree = "<group>"; };
|
||||
D9EE7437158A8BD400EC1D05 /* google_plus_share.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = google_plus_share.png; path = ../Resources/google_plus_share.png; sourceTree = "<group>"; };
|
||||
@@ -279,9 +277,10 @@
|
||||
D9EE7434158A8BB500EC1D05 /* GooglePlusSDK */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D9EE7431158A8BAE00EC1D05 /* GooglePlusShare.h */,
|
||||
D9EE7432158A8BAE00EC1D05 /* GooglePlusSignIn.h */,
|
||||
D9EE7433158A8BAE00EC1D05 /* GooglePlusSignInButton.h */,
|
||||
D9EE7431158A8BAE00EC1D05 /* GPPShare.h */,
|
||||
294FD685163B67F500A9D5CA /* GPPDeepLink.h */,
|
||||
D9EE7432158A8BAE00EC1D05 /* GPPSignIn.h */,
|
||||
D9EE7433158A8BAE00EC1D05 /* GPPSignInButton.h */,
|
||||
D9EE74AD158A8D1E00EC1D05 /* libGooglePlus.a */,
|
||||
D9EE74AE158A8D1E00EC1D05 /* libGooglePlusUniversal.a */,
|
||||
D9EE7445158A8BDB00EC1D05 /* Resources */,
|
||||
@@ -386,8 +385,6 @@
|
||||
D9EE745E158A8C0E00EC1D05 /* GTLPlusItemScope.m */,
|
||||
D9EE745F158A8C0E00EC1D05 /* GTLPlusMoment.h */,
|
||||
D9EE7460158A8C0E00EC1D05 /* GTLPlusMoment.m */,
|
||||
D98254F0159937730060CA47 /* GTLPlusPerson.h */,
|
||||
D98254F1159937730060CA47 /* GTLPlusPerson.m */,
|
||||
D9EE7463158A8C0E00EC1D05 /* GTLQueryPlus.h */,
|
||||
D9EE7464158A8C0E00EC1D05 /* GTLQueryPlus.m */,
|
||||
D9EE7465158A8C0E00EC1D05 /* GTLServicePlus.h */,
|
||||
@@ -510,7 +507,6 @@
|
||||
D9EE74C5158A8E0500EC1D05 /* GooglePlusSampleMomentsViewController.m in Sources */,
|
||||
D9EE74C7158A8E0500EC1D05 /* GooglePlusSampleShareViewController.m in Sources */,
|
||||
D9EE74C9158A8E0500EC1D05 /* GooglePlusSampleSignInViewController.m in Sources */,
|
||||
D98254F2159937730060CA47 /* GTLPlusPerson.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
Binary file not shown.
@@ -1,84 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0043C7991580045B000DF02E"
|
||||
BuildableName = "GooglePlusSample.app"
|
||||
BlueprintName = "GooglePlusSample"
|
||||
ReferencedContainer = "container:GooglePlusSample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0043C7991580045B000DF02E"
|
||||
BuildableName = "GooglePlusSample.app"
|
||||
BlueprintName = "GooglePlusSample"
|
||||
ReferencedContainer = "container:GooglePlusSample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0043C7991580045B000DF02E"
|
||||
BuildableName = "GooglePlusSample.app"
|
||||
BlueprintName = "GooglePlusSample"
|
||||
ReferencedContainer = "container:GooglePlusSample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "0043C7991580045B000DF02E"
|
||||
BuildableName = "GooglePlusSample.app"
|
||||
BlueprintName = "GooglePlusSample"
|
||||
ReferencedContainer = "container:GooglePlusSample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>GooglePlusSample.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>0043C7991580045B000DF02E</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
@@ -18,8 +18,8 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class GooglePlusShare;
|
||||
@class GooglePlusSignInButton;
|
||||
@class GPPShare;
|
||||
@class GPPSignInButton;
|
||||
@class GTMOAuth2Authentication;
|
||||
|
||||
@interface GooglePlusSampleAppDelegate : UIResponder<UIApplicationDelegate>
|
||||
@@ -29,11 +29,14 @@
|
||||
// The navigation controller.
|
||||
@property (retain, nonatomic) UINavigationController *navigationController;
|
||||
// The Google+ sign-in button to handle the URL redirect.
|
||||
@property (retain, nonatomic) GooglePlusSignInButton *signInButton;
|
||||
@property (retain, nonatomic) GPPSignInButton *signInButton;
|
||||
// The OAuth 2.0 authentication used in the application.
|
||||
@property (retain, nonatomic) GTMOAuth2Authentication *auth;
|
||||
// The Google+ share object to handle the URL redirect.
|
||||
@property (retain, nonatomic) GooglePlusShare *share;
|
||||
@property (retain, nonatomic) GPPShare *share;
|
||||
// Whether or not to use Google+ history's
|
||||
// https://www.googleapis.com/auth/plus.moments.write scope.
|
||||
@property (assign, nonatomic) BOOL plusMomentsWriteScope;
|
||||
|
||||
// The OAuth 2.0 client ID to be used for Google+ sign-in, share, and moments.
|
||||
+ (NSString *)clientID;
|
||||
|
@@ -19,8 +19,9 @@
|
||||
#import "GooglePlusSampleAppDelegate.h"
|
||||
|
||||
#import "GooglePlusSampleMasterViewController.h"
|
||||
#import "GooglePlusSignIn.h"
|
||||
#import "GooglePlusSignInButton.h"
|
||||
#import "GPPDeepLink.h"
|
||||
#import "GPPSignIn.h"
|
||||
#import "GPPSignInButton.h"
|
||||
|
||||
@implementation GooglePlusSampleAppDelegate
|
||||
|
||||
@@ -29,11 +30,12 @@
|
||||
@synthesize signInButton = signInButton_;
|
||||
@synthesize auth = auth_;
|
||||
@synthesize share = share_;
|
||||
@synthesize plusMomentsWriteScope = plusMomentsWriteScope_;
|
||||
|
||||
// DO NOT USE THIS CLIENT ID. IT WILL NOT WORK FOR YOUR APP.
|
||||
// Please use the client ID created for you by Google.
|
||||
static NSString * const kClientID = @"571459971810-"
|
||||
@"2bpoda566pap5kkc0aqljqfjki8tgeb6.apps.googleusercontent.com";
|
||||
static NSString * const kClientID =
|
||||
@"122385832599-2mcvobo565un3ab7d6d06m6fjemocto9.apps.googleusercontent.com";
|
||||
|
||||
+ (NSString *)clientID {
|
||||
return kClientID;
|
||||
@@ -52,6 +54,8 @@ static NSString * const kClientID = @"571459971810-"
|
||||
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
plusMomentsWriteScope_ = YES;
|
||||
|
||||
self.window = [[[UIWindow alloc]
|
||||
initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
|
||||
GooglePlusSampleMasterViewController *masterViewController =
|
||||
@@ -63,6 +67,18 @@ static NSString * const kClientID = @"571459971810-"
|
||||
initWithRootViewController:masterViewController] autorelease];
|
||||
self.window.rootViewController = self.navigationController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
// Read Google+ deep-link data.
|
||||
GPPDeepLink *deepLink = [GPPDeepLink readDeepLinkAfterInstall];
|
||||
if (deepLink) {
|
||||
UIAlertView *alert = [[[UIAlertView alloc]
|
||||
initWithTitle:@"Read Deep-link Data"
|
||||
message:[deepLink deepLinkID]
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil] autorelease];
|
||||
[alert show];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -83,6 +99,20 @@ static NSString * const kClientID = @"571459971810-"
|
||||
annotation:annotation]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
// Handle Google+ deep-link data URL.
|
||||
GPPDeepLink *deepLink = [GPPDeepLink handleURL:url
|
||||
sourceApplication:sourceApplication
|
||||
annotation:annotation];
|
||||
if (deepLink) {
|
||||
UIAlertView *alert = [[[UIAlertView alloc]
|
||||
initWithTitle:@"Handle Deep-link Data"
|
||||
message:[deepLink deepLinkID]
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil] autorelease];
|
||||
[alert show];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
|
||||
#import "GooglePlusSampleMasterViewController.h"
|
||||
|
||||
#import "GooglePlusSampleAppDelegate.h"
|
||||
#import "GooglePlusSampleShareViewController.h"
|
||||
#import "GooglePlusSampleSignInViewController.h"
|
||||
#import "GooglePlusSampleMomentsViewController.h"
|
||||
@@ -25,10 +26,19 @@
|
||||
static const int kNumViewControllers = 3;
|
||||
static NSString * const kMenuOptions[kNumViewControllers] = {
|
||||
@"Sign In", @"Share", @"Moments" };
|
||||
static NSString * const kUnselectableMenuOptions[kNumViewControllers] = {
|
||||
@"", @"", @"Sign in to use moments" };
|
||||
static NSString * const kNibNames[kNumViewControllers] = {
|
||||
@"GooglePlusSampleSignInViewController",
|
||||
@"GooglePlusSampleShareViewController",
|
||||
@"GooglePlusSampleMomentsViewController" };
|
||||
static const int kMomentsIndex = 2;
|
||||
|
||||
@interface GooglePlusSampleMasterViewController () {
|
||||
NSIndexPath *momentsIndexPath_;
|
||||
}
|
||||
- (BOOL)isSelectable:(NSIndexPath *)indexPath;
|
||||
@end
|
||||
|
||||
@implementation GooglePlusSampleMasterViewController
|
||||
|
||||
@@ -47,6 +57,11 @@ static NSString * const kNibNames[kNumViewControllers] = {
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[momentsIndexPath_ release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark - View lifecycle
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)
|
||||
@@ -58,6 +73,15 @@ static NSString * const kNibNames[kNumViewControllers] = {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
if (momentsIndexPath_) {
|
||||
[self.tableView
|
||||
reloadRowsAtIndexPaths:[NSArray arrayWithObject:momentsIndexPath_]
|
||||
withRowAnimation:UITableViewRowAnimationFade];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate/UITableViewDataSource
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
@@ -71,22 +95,32 @@ static NSString * const kNibNames[kNumViewControllers] = {
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView
|
||||
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
static NSString * const kCellIdentifier = @"Cell";
|
||||
BOOL selectable = [self isSelectable:indexPath];
|
||||
NSString * const kCellIdentifier = selectable ? @"Cell" : @"GreyCell";
|
||||
UITableViewCell *cell =
|
||||
[tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
|
||||
if (cell == nil) {
|
||||
cell =
|
||||
[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
||||
reuseIdentifier:kCellIdentifier] autorelease];
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
if (selectable) {
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
} else {
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.textLabel.textColor = [UIColor lightGrayColor];
|
||||
}
|
||||
}
|
||||
cell.textLabel.text = (selectable ? kMenuOptions : kUnselectableMenuOptions)
|
||||
[indexPath.row];
|
||||
|
||||
cell.textLabel.text = kMenuOptions[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView
|
||||
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (![self isSelectable:indexPath]) {
|
||||
return;
|
||||
}
|
||||
Class nibClass = NSClassFromString(kNibNames[indexPath.row]);
|
||||
UIViewController *controller =
|
||||
[[[nibClass alloc] initWithNibName:nil bundle:nil] autorelease];
|
||||
@@ -95,4 +129,19 @@ static NSString * const kNibNames[kNumViewControllers] = {
|
||||
[self.navigationController pushViewController:controller animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Helper methods
|
||||
|
||||
- (BOOL)isSelectable:(NSIndexPath *)indexPath {
|
||||
if (indexPath.row == kMomentsIndex) {
|
||||
if (!momentsIndexPath_) {
|
||||
momentsIndexPath_ = [indexPath retain];
|
||||
}
|
||||
// To use Google+ History API, you need to sign in.
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
return appDelegate.auth && appDelegate.plusMomentsWriteScope;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#import "GooglePlusSampleMomentsViewController.h"
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import "GooglePlusSampleAppDelegate.h"
|
||||
#import "GTLPlus.h"
|
||||
#import "GTLPlusConstants.h"
|
||||
#import "GTLPlusItemScope.h"
|
||||
@@ -27,7 +28,6 @@
|
||||
#import "GTLServicePlus.h"
|
||||
#import "GTMLogger.h"
|
||||
#import "GTMOAuth2Authentication.h"
|
||||
#import "GooglePlusSampleAppDelegate.h"
|
||||
|
||||
@interface GooglePlusSampleMomentsViewController ()
|
||||
- (GTLPlusItemScope *)resultFor:(NSString *)selectedMoment;
|
||||
@@ -162,7 +162,7 @@ static NSString * const kMomentURLFormat =
|
||||
NSString *selectedMoment = kMomentTypes[selectedRow];
|
||||
|
||||
GTLPlusMoment *moment = [[[GTLPlusMoment alloc] init] autorelease];
|
||||
moment.type = [NSString stringWithFormat:@"https://schemas.google.com/%@",
|
||||
moment.type = [NSString stringWithFormat:@"http://schemas.google.com/%@",
|
||||
selectedMoment];
|
||||
GTLPlusItemScope *target = [[[GTLPlusItemScope alloc] init] autorelease];
|
||||
target.url = momentURL_.text;
|
||||
@@ -258,8 +258,8 @@ static NSString * const kMomentURLFormat =
|
||||
GTLPlusItemScope *result = [[[GTLPlusItemScope alloc] init] autorelease];
|
||||
if ([selectedMoment isEqualToString:@"CommentActivity"]) {
|
||||
result.type = @"http://schema.org/Comment";
|
||||
result.url =
|
||||
@"https://developers.google.com/+/plugins/snippet/examples/blog-entry#comment-1";
|
||||
result.url = @"https://developers.google.com/+/plugins/snippet/"
|
||||
@"examples/blog-entry#comment-1";
|
||||
result.name = @"This is amazing!";
|
||||
result.text = @"I can't wait to use it on my site :)";
|
||||
return result;
|
||||
@@ -272,16 +272,15 @@ static NSString * const kMomentURLFormat =
|
||||
result.type = @"http://schema.org/Review";
|
||||
result.name = @"A Humble Review of Widget";
|
||||
result.url =
|
||||
@"https://developers.google.com/+/plugins/snippet/examples/review";
|
||||
@"https://developers.google.com/+/plugins/snippet/examples/review";
|
||||
result.text =
|
||||
@"It's amazingly effective at whatever it is that it's supposed to do.";
|
||||
@"It's amazingly effective at whatever it is that it's supposed to do.";
|
||||
GTLPlusItemScope *rating = [[[GTLPlusItemScope alloc] init] autorelease];
|
||||
rating.type = @"http://schema.org/Rating";
|
||||
rating.ratingValue = @"100";
|
||||
rating.bestRating = @"100";
|
||||
rating.worstRating = @"0";
|
||||
result.reviewRating =
|
||||
[[[NSArray alloc] initWithObjects:rating, nil] autorelease];
|
||||
result.reviewRating = rating;
|
||||
return result;
|
||||
}
|
||||
return nil;
|
||||
|
@@ -19,18 +19,22 @@
|
||||
#import <MessageUI/MFMailComposeViewController.h>
|
||||
#import <MessageUI/MessageUI.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GooglePlusShare.h"
|
||||
#import "GPPShare.h"
|
||||
|
||||
// A view controller for the Google+ share dialog which contains a text field
|
||||
// to prefill the user comment, and a text field for an optional URL to share.
|
||||
// A Google+ share button is provided to launch the share dialog.
|
||||
@interface GooglePlusSampleShareViewController : UIViewController<
|
||||
GooglePlusShareDelegate,
|
||||
GPPShareDelegate,
|
||||
UITextFieldDelegate,
|
||||
UIActionSheetDelegate,
|
||||
MFMailComposeViewControllerDelegate> {
|
||||
// The Google+ share object to manage the share dialog.
|
||||
GooglePlusShare *share_;
|
||||
GPPShare *share_;
|
||||
// Whether the keyboard is visible or not.
|
||||
BOOL keyboardVisible_;
|
||||
// The text field being edited.
|
||||
UITextField *activeField_;
|
||||
}
|
||||
|
||||
// The text to prefill the user comment in the share dialog.
|
||||
@@ -41,7 +45,36 @@
|
||||
@property (retain, nonatomic) IBOutlet UILabel *shareStatus;
|
||||
// A toolbar to share via Google+ or email.
|
||||
@property (retain, nonatomic) IBOutlet UIToolbar *shareToolbar;
|
||||
// A switch to toggle Google+ share with deep linking.
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *attachDeepLinkSwitch;
|
||||
// The deep-link ID to be attached with the Google+ share to qualify as
|
||||
// a deep-link share.
|
||||
@property (retain, nonatomic) IBOutlet UITextField *deepLinkID;
|
||||
// The share's title.
|
||||
@property (retain, nonatomic) IBOutlet UITextField *deepLinkTitle;
|
||||
// The share's description.
|
||||
@property (retain, nonatomic) IBOutlet UITextField *deepLinkDescription;
|
||||
// The share's thumbnail URL.
|
||||
@property (retain, nonatomic) IBOutlet UITextField *deepLinkThumbnailURL;
|
||||
// The share view.
|
||||
@property (retain, nonatomic) IBOutlet UIScrollView *shareScrollView;
|
||||
@property (retain, nonatomic) IBOutlet UIView *shareView;
|
||||
// Labels for Google+ share sample.
|
||||
@property (retain, nonatomic) IBOutlet UILabel *attachDeepLinkDataLabel;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *urlToShareLabel;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *prefillTextLabel;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *deepLinkIDLabel;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *deepLinkTitleLabel;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *deepLinkDescriptionLabel;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *deepLinkThumbnailURLLabel;
|
||||
@property (retain, nonatomic) IBOutlet UIButton *shareButton;
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *urlForDeepLinkMetadataSwitch;
|
||||
@property (retain, nonatomic) IBOutlet UILabel *urlForDeepLinkMetadataLabel;
|
||||
|
||||
// Called when the switch for deep-link data is toggled.
|
||||
- (IBAction)deepLinkSwitchToggle:(id)sender;
|
||||
// Called when the switch for metadata from URL preview is toggled.
|
||||
- (IBAction)urlForDeepLinkMetadataSwitchToggle:(id)sender;
|
||||
// Called when the share button is pressed.
|
||||
- (IBAction)shareButton:(id)sender;
|
||||
// Called when the toolbar share button is pressed.
|
||||
|
@@ -20,19 +20,61 @@
|
||||
|
||||
#import "GooglePlusSampleAppDelegate.h"
|
||||
|
||||
@interface GooglePlusSampleShareViewController()
|
||||
- (void)animateKeyboard:(NSNotification *)notification
|
||||
shouldShow:(BOOL)shouldShow;
|
||||
- (void)layout;
|
||||
- (void)placeView:(UIView *)view x:(CGFloat)x y:(CGFloat)y;
|
||||
- (void)populateTextFields;
|
||||
@end
|
||||
|
||||
@implementation GooglePlusSampleShareViewController
|
||||
|
||||
@synthesize attachDeepLinkSwitch = attachDeepLinkSwitch_;
|
||||
@synthesize deepLinkDescription = deepLinkDescription_;
|
||||
@synthesize deepLinkID = deepLinkID_;
|
||||
@synthesize deepLinkTitle = deepLinkTitle_;
|
||||
@synthesize deepLinkThumbnailURL = deepLinkThumbnailURL_;
|
||||
@synthesize sharePrefillText = sharePrefillText_;
|
||||
@synthesize shareURL = shareURL_;
|
||||
@synthesize shareStatus = shareStatus_;
|
||||
@synthesize shareToolbar = shareToolbar_;
|
||||
@synthesize shareScrollView = shareScrollView_;
|
||||
@synthesize shareView = shareView_;
|
||||
@synthesize attachDeepLinkDataLabel = attachDeepLinkDataLabel_;
|
||||
@synthesize urlToShareLabel = urlToShareLabel_;
|
||||
@synthesize prefillTextLabel = prefillTextLabel_;
|
||||
@synthesize deepLinkIDLabel = deepLinkIDLabel_;
|
||||
@synthesize deepLinkTitleLabel = deepLinkTitleLabel_;
|
||||
@synthesize deepLinkDescriptionLabel = deepLinkDescriptionLabel_;
|
||||
@synthesize deepLinkThumbnailURLLabel = deepLinkThumbnailURLLabel_;
|
||||
@synthesize shareButton = shareButton_;
|
||||
@synthesize urlForDeepLinkMetadataSwitch = urlForDeepLinkMetadataSwitch_;
|
||||
@synthesize urlForDeepLinkMetadataLabel = urlForDeepLinkMetadataLabel_;
|
||||
|
||||
- (void)dealloc {
|
||||
[attachDeepLinkSwitch_ release];
|
||||
[deepLinkID_ release];
|
||||
[deepLinkTitle_ release];
|
||||
[deepLinkDescription_ release];
|
||||
[deepLinkThumbnailURL_ release];
|
||||
[sharePrefillText_ release];
|
||||
[shareURL_ release];
|
||||
[shareStatus_ release];
|
||||
[share_ release];
|
||||
[shareToolbar_ release];
|
||||
[shareScrollView_ release];
|
||||
[shareView_ release];
|
||||
[attachDeepLinkDataLabel_ release];
|
||||
[urlToShareLabel_ release];
|
||||
[prefillTextLabel_ release];
|
||||
[deepLinkIDLabel_ release];
|
||||
[deepLinkTitleLabel_ release];
|
||||
[deepLinkDescriptionLabel_ release];
|
||||
[deepLinkThumbnailURLLabel_ release];
|
||||
[shareButton_ release];
|
||||
[urlForDeepLinkMetadataSwitch_ release];
|
||||
[urlForDeepLinkMetadataLabel_ release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -43,10 +85,14 @@
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
NSString *clientID = [GooglePlusSampleAppDelegate clientID];
|
||||
share_ = [[GooglePlusShare alloc] initWithClientID:clientID];
|
||||
share_ = [[GPPShare alloc] initWithClientID:clientID];
|
||||
share_.delegate = self;
|
||||
appDelegate.share = share_;
|
||||
|
||||
[attachDeepLinkSwitch_ setOn:NO];
|
||||
|
||||
[self layout];
|
||||
[self populateTextFields];
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
@@ -57,10 +103,69 @@
|
||||
share_.delegate = nil;
|
||||
[share_ release];
|
||||
share_ = nil;
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver:self
|
||||
name:UIKeyboardWillShowNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver:self
|
||||
name:UIKeyboardWillHideNotification
|
||||
object:nil];
|
||||
|
||||
[self setAttachDeepLinkSwitch:nil];
|
||||
[self setDeepLinkID:nil];
|
||||
[self setDeepLinkTitle:nil];
|
||||
[self setDeepLinkDescription:nil];
|
||||
[self setDeepLinkThumbnailURL:nil];
|
||||
[self setShareScrollView:nil];
|
||||
[self setShareView:nil];
|
||||
[self setShareToolbar:nil];
|
||||
[self setAttachDeepLinkDataLabel:nil];
|
||||
[self setUrlToShareLabel:nil];
|
||||
[self setPrefillTextLabel:nil];
|
||||
[self setDeepLinkIDLabel:nil];
|
||||
[self setDeepLinkTitleLabel:nil];
|
||||
[self setDeepLinkDescriptionLabel:nil];
|
||||
[self setDeepLinkThumbnailURLLabel:nil];
|
||||
[self setShareButton:nil];
|
||||
[self setUrlForDeepLinkMetadataSwitch:nil];
|
||||
[self setUrlForDeepLinkMetadataLabel:nil];
|
||||
[super viewDidUnload];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
|
||||
shareScrollView_.frame = self.view.frame;
|
||||
}
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
// Register for keyboard notifications while visible.
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(keyboardWillShow:)
|
||||
name:UIKeyboardWillShowNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(keyboardWillHide:)
|
||||
name:UIKeyboardWillHideNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
// Unregister for keyboard notifications while not visible.
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver:self
|
||||
name:UIKeyboardWillShowNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver:self
|
||||
name:UIKeyboardWillHideNotification
|
||||
object:nil];
|
||||
|
||||
[super viewWillDisappear:animated];
|
||||
}
|
||||
|
||||
#pragma mark - UITextFieldDelegate
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
@@ -68,7 +173,15 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - GooglePlusShareDelegate
|
||||
- (void)textFieldDidBeginEditing:(UITextField *)textField {
|
||||
activeField_ = textField;
|
||||
}
|
||||
|
||||
- (void)textFieldDidEndEditing:(UITextField *)textField {
|
||||
activeField_ = nil;
|
||||
}
|
||||
|
||||
#pragma mark - GPPShareDelegate
|
||||
|
||||
- (void)finishedSharing:(BOOL)shared {
|
||||
NSString *text = shared ? @"Success" : @"Canceled";
|
||||
@@ -120,15 +233,49 @@
|
||||
[self dismissModalViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - UIKeyboard
|
||||
|
||||
- (void)keyboardWillShow:(NSNotification *)notification {
|
||||
[self animateKeyboard:notification shouldShow:YES];
|
||||
}
|
||||
|
||||
- (void)keyboardWillHide:(NSNotification *)notification {
|
||||
[self animateKeyboard:notification shouldShow:NO];
|
||||
}
|
||||
|
||||
#pragma mark - IBActions
|
||||
|
||||
- (IBAction)shareButton:(id)sender {
|
||||
shareStatus_.text = @"Status: Sharing...";
|
||||
id<GPPShareBuilder> shareBuilder = [share_ shareDialog];
|
||||
|
||||
NSString *inputURL = shareURL_.text;
|
||||
NSURL *urlToShare = [inputURL length] ? [NSURL URLWithString:inputURL] : nil;
|
||||
if (urlToShare) {
|
||||
shareBuilder = [shareBuilder setURLToShare:urlToShare];
|
||||
}
|
||||
|
||||
if ([deepLinkID_ text]) {
|
||||
shareBuilder = [shareBuilder setContentDeepLinkID:[deepLinkID_ text]];
|
||||
NSString *title = [deepLinkTitle_ text];
|
||||
NSString *description = [deepLinkDescription_ text];
|
||||
if (title && description) {
|
||||
NSURL *thumbnailURL = [NSURL URLWithString:[deepLinkThumbnailURL_ text]];
|
||||
shareBuilder = [shareBuilder setTitle:title
|
||||
description:description
|
||||
thumbnailURL:thumbnailURL];
|
||||
}
|
||||
}
|
||||
|
||||
NSString *inputText = sharePrefillText_.text;
|
||||
NSString *text = [inputText length] ? inputText : nil;
|
||||
shareStatus_.text = @"Status: Sharing...";
|
||||
[[[[share_ shareDialog] setURLToShare:urlToShare] setPrefillText:text] open];
|
||||
if (text) {
|
||||
shareBuilder = [shareBuilder setPrefillText:text];
|
||||
}
|
||||
|
||||
if (![shareBuilder open]) {
|
||||
shareStatus_.text = @"Status: Error (see console).";
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)shareToolbar:(id)sender {
|
||||
@@ -142,4 +289,210 @@
|
||||
[actionSheet showFromToolbar:shareToolbar_];
|
||||
}
|
||||
|
||||
- (IBAction)urlForDeepLinkMetadataSwitchToggle:(id)sender {
|
||||
[self layout];
|
||||
[self populateTextFields];
|
||||
}
|
||||
|
||||
- (IBAction)deepLinkSwitchToggle:(id)sender {
|
||||
if (!attachDeepLinkSwitch_.on) {
|
||||
[urlForDeepLinkMetadataSwitch_ setOn:YES];
|
||||
}
|
||||
[self layout];
|
||||
[self populateTextFields];
|
||||
}
|
||||
|
||||
#pragma mark - helper methods
|
||||
|
||||
- (void) placeView:(UIView *)view x:(CGFloat)x y:(CGFloat)y {
|
||||
CGSize frameSize = view.frame.size;
|
||||
view.frame = CGRectMake(x, y, frameSize.width, frameSize.height);
|
||||
}
|
||||
|
||||
- (void) layout {
|
||||
CGFloat originX = 20.0;
|
||||
CGFloat originY = 20.0;
|
||||
CGFloat yPadding = 20.0;
|
||||
CGFloat currentY = originY;
|
||||
CGFloat middleX = 150;
|
||||
|
||||
// Place the switch for attaching deep-link data.
|
||||
[self placeView:attachDeepLinkDataLabel_ x:originX y:currentY];
|
||||
[self placeView:attachDeepLinkSwitch_ x:middleX + 50 y:currentY];
|
||||
CGSize frameSize = attachDeepLinkSwitch_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
// Place the switch for preview URL.
|
||||
if (attachDeepLinkSwitch_.on) {
|
||||
[self placeView:urlForDeepLinkMetadataLabel_ x:originX y:currentY];
|
||||
[self placeView:urlForDeepLinkMetadataSwitch_ x:middleX + 50 y:currentY];
|
||||
frameSize = urlForDeepLinkMetadataSwitch_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
urlForDeepLinkMetadataSwitch_.hidden = NO;
|
||||
urlForDeepLinkMetadataLabel_.hidden = NO;
|
||||
} else {
|
||||
urlForDeepLinkMetadataSwitch_.hidden = YES;
|
||||
urlForDeepLinkMetadataLabel_.hidden = YES;
|
||||
}
|
||||
|
||||
// Place the field for URL to share.
|
||||
if (urlForDeepLinkMetadataSwitch_.on) {
|
||||
[self placeView:urlToShareLabel_ x:originX y:currentY];
|
||||
frameSize = urlToShareLabel_.frame.size;
|
||||
currentY += frameSize.height + 0.5 * yPadding;
|
||||
|
||||
[self placeView:shareURL_ x:originX y:currentY];
|
||||
frameSize = shareURL_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
urlToShareLabel_.hidden = NO;
|
||||
shareURL_.hidden = NO;
|
||||
} else {
|
||||
urlToShareLabel_.hidden = YES;
|
||||
shareURL_.hidden = YES;
|
||||
}
|
||||
|
||||
// Place the field for prefill text.
|
||||
[self placeView:prefillTextLabel_ x:originX y:currentY];
|
||||
frameSize = prefillTextLabel_.frame.size;
|
||||
currentY += frameSize.height + 0.5 * yPadding;
|
||||
[self placeView:sharePrefillText_ x:originX y:currentY];
|
||||
frameSize = sharePrefillText_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
// Place the content deep-link ID field.
|
||||
if (attachDeepLinkSwitch_.on) {
|
||||
[self placeView:deepLinkIDLabel_ x:originX y:currentY];
|
||||
frameSize = deepLinkIDLabel_.frame.size;
|
||||
currentY += frameSize.height + 0.5 * yPadding;
|
||||
[self placeView:deepLinkID_ x:originX y:currentY];
|
||||
frameSize = deepLinkID_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
deepLinkIDLabel_.hidden = NO;
|
||||
deepLinkID_.hidden = NO;
|
||||
} else {
|
||||
deepLinkIDLabel_.hidden = YES;
|
||||
deepLinkID_.hidden = YES;
|
||||
}
|
||||
|
||||
// Place fields for content deep-link metadata.
|
||||
if (attachDeepLinkSwitch_.on && !urlForDeepLinkMetadataSwitch_.on) {
|
||||
[self placeView:deepLinkTitleLabel_ x:originX y:currentY];
|
||||
frameSize = deepLinkTitleLabel_.frame.size;
|
||||
currentY += frameSize.height + 0.5 * yPadding;
|
||||
[self placeView:deepLinkTitle_ x:originX y:currentY];
|
||||
frameSize = deepLinkTitle_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
[self placeView:deepLinkDescriptionLabel_ x:originX y:currentY];
|
||||
frameSize = deepLinkDescriptionLabel_.frame.size;
|
||||
currentY += frameSize.height + 0.5 * yPadding;
|
||||
[self placeView:deepLinkDescription_ x:originX y:currentY];
|
||||
frameSize = deepLinkDescription_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
[self placeView:deepLinkThumbnailURLLabel_ x:originX y:currentY];
|
||||
frameSize = deepLinkThumbnailURLLabel_.frame.size;
|
||||
currentY += frameSize.height + 0.5 * yPadding;
|
||||
[self placeView:deepLinkThumbnailURL_ x:originX y:currentY];
|
||||
frameSize = deepLinkThumbnailURL_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
deepLinkTitle_.hidden = NO;
|
||||
deepLinkTitleLabel_.hidden = NO;
|
||||
deepLinkDescriptionLabel_.hidden = NO;
|
||||
deepLinkDescription_.hidden = NO;
|
||||
deepLinkThumbnailURLLabel_.hidden = NO;
|
||||
deepLinkThumbnailURL_.hidden = NO;
|
||||
} else {
|
||||
deepLinkTitle_.hidden = YES;
|
||||
deepLinkTitleLabel_.hidden = YES;
|
||||
deepLinkDescriptionLabel_.hidden = YES;
|
||||
deepLinkDescription_.hidden = YES;
|
||||
deepLinkThumbnailURLLabel_.hidden = YES;
|
||||
deepLinkThumbnailURL_.hidden = YES;
|
||||
}
|
||||
|
||||
// Place the share button and status.
|
||||
[self placeView:shareButton_ x:originX y:currentY];
|
||||
frameSize = shareButton_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
[self placeView:shareStatus_ x:originX y:currentY];
|
||||
frameSize = shareStatus_.frame.size;
|
||||
currentY += frameSize.height + yPadding;
|
||||
|
||||
shareScrollView_.contentSize =
|
||||
CGSizeMake(shareScrollView_.frame.size.width, currentY);
|
||||
}
|
||||
|
||||
- (void)populateTextFields {
|
||||
// Pre-populate text fields for Google+ share sample.
|
||||
if (sharePrefillText_.hidden) {
|
||||
sharePrefillText_.text = @"";
|
||||
} else {
|
||||
sharePrefillText_.text = @"Welcome to Google+ Platform";
|
||||
}
|
||||
|
||||
if (shareURL_.hidden) {
|
||||
shareURL_.text = @"";
|
||||
} else {
|
||||
shareURL_.text = @"http://developers.google.com";
|
||||
}
|
||||
|
||||
if (deepLinkID_.hidden) {
|
||||
deepLinkID_.text = @"";
|
||||
} else {
|
||||
deepLinkID_.text = @"reviews/314159265358";
|
||||
}
|
||||
|
||||
if (deepLinkTitle_.hidden) {
|
||||
deepLinkTitle_.text = @"";
|
||||
} else {
|
||||
deepLinkTitle_.text = @"Joe's Diner Review";
|
||||
}
|
||||
|
||||
if (deepLinkDescription_.hidden) {
|
||||
deepLinkDescription_.text = @"";
|
||||
} else {
|
||||
deepLinkDescription_.text = @"Check out my review of the awesome toast!";
|
||||
}
|
||||
|
||||
if (deepLinkThumbnailURL_.hidden) {
|
||||
deepLinkThumbnailURL_.text = @"";
|
||||
} else {
|
||||
deepLinkThumbnailURL_.text =
|
||||
@"http://www.google.com/logos/2012/childrensday-2012-hp.jpg";
|
||||
}
|
||||
}
|
||||
|
||||
- (void)animateKeyboard:(NSNotification *)notification
|
||||
shouldShow:(BOOL)shouldShow {
|
||||
if (!shouldShow) {
|
||||
UIEdgeInsets contentInsets = UIEdgeInsetsZero;
|
||||
shareScrollView_.contentInset = contentInsets;
|
||||
shareScrollView_.scrollIndicatorInsets = contentInsets;
|
||||
return;
|
||||
}
|
||||
|
||||
NSDictionary *userInfo = [notification userInfo];
|
||||
CGRect kbFrame =
|
||||
[[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
|
||||
CGSize kbSize = kbFrame.size;
|
||||
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0);
|
||||
shareScrollView_.contentInset = contentInsets;
|
||||
shareScrollView_.scrollIndicatorInsets = contentInsets;
|
||||
|
||||
// If active text field is hidden by keyboard, scroll so it's visible.
|
||||
CGRect aRect = self.view.frame;
|
||||
aRect.size.height -= kbSize.height;
|
||||
CGPoint bottomLeft =
|
||||
CGPointMake(0.0, activeField_.frame.origin.y +
|
||||
activeField_.frame.size.height + 10);
|
||||
if (!CGRectContainsPoint(aRect, bottomLeft)) {
|
||||
CGPoint scrollPoint = CGPointMake(0.0, bottomLeft.y - aRect.size.height);
|
||||
[shareScrollView_ setContentOffset:scrollPoint animated:YES];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@end
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// GooglePlusSignInViewController.h
|
||||
// GooglePlusSampleSignInViewController.h
|
||||
//
|
||||
// Copyright 2012 Google Inc.
|
||||
//
|
||||
@@ -17,24 +17,39 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GooglePlusSignIn.h"
|
||||
#import "GPPSignIn.h"
|
||||
|
||||
@class GooglePlusSignInButton;
|
||||
@class GPPSignInButton;
|
||||
|
||||
// A view controller for the Google+ sign-in button which initiates a standard
|
||||
// OAuth 2.0 flow and provides an access token and a refresh token. A "Sign out"
|
||||
// button is provided to allow users to sign out of this application.
|
||||
@interface GooglePlusSampleSignInViewController : UIViewController<
|
||||
GooglePlusSignInDelegate>
|
||||
GPPSignInDelegate>
|
||||
|
||||
// The button that handles Google+ sign-in.
|
||||
@property (retain, nonatomic) IBOutlet GooglePlusSignInButton *signInButton;
|
||||
@property (retain, nonatomic) IBOutlet GPPSignInButton *signInButton;
|
||||
// A label to display the result of the sign-in action.
|
||||
@property (retain, nonatomic) IBOutlet UILabel *signInAuthStatus;
|
||||
// A label to display the signed-in user's display name.
|
||||
@property (retain, nonatomic) IBOutlet UILabel *signInDisplayName;
|
||||
// A button to sign out of this application.
|
||||
@property (retain, nonatomic) IBOutlet UIButton *signOutButton;
|
||||
// A switch for whether to request for Google+ History's
|
||||
// https://www.googleapis.com/auth/plus.moments.write scope.
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *plusMomentsWriteScope;
|
||||
// A switch for whether to request
|
||||
// https://www.googleapis.com/auth/userinfo.email scope to get user's email
|
||||
// address after the sign-in action.
|
||||
@property (retain, nonatomic) IBOutlet UISwitch *userinfoEmailScope;
|
||||
|
||||
// Called when the user presses the "Sign out" button.
|
||||
- (IBAction)signOut:(id)sender;
|
||||
// Called when the user toggles Google+ History's
|
||||
// https://www.googleapis.com/auth/plus.moments.write scope.
|
||||
- (IBAction)plusMomentsWriteScopeToggle:(id)sender;
|
||||
// Called when the user toggles the
|
||||
// https://www.googleapis.com/auth/userinfo.email scope.
|
||||
- (IBAction)userinfoEmailScopeToggle:(id)sender;
|
||||
|
||||
@end
|
||||
|
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// GooglePlusSignInViewController.m
|
||||
// GooglePlusSampleSignInViewController.m
|
||||
//
|
||||
// Copyright 2012 Google Inc.
|
||||
//
|
||||
@@ -20,36 +20,50 @@
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import "GooglePlusSampleAppDelegate.h"
|
||||
#import "GooglePlusSignIn.h"
|
||||
#import "GooglePlusSignInButton.h"
|
||||
#import "GPPSignIn.h"
|
||||
#import "GPPSignInButton.h"
|
||||
#import "GTLPlus.h"
|
||||
#import "GTLPlusConstants.h"
|
||||
#import "GTLQueryPlus.h"
|
||||
#import "GTLServicePlus.h"
|
||||
#import "GTMLogger.h"
|
||||
#import "GTMOAuth2Authentication.h"
|
||||
|
||||
@interface GooglePlusSampleSignInViewController () {
|
||||
// Saved state of |userinfoEmailScope_.on|.
|
||||
BOOL savedUserinfoEmailScopeState_;
|
||||
}
|
||||
- (GooglePlusSampleAppDelegate *)appDelegate;
|
||||
- (void)setSignInScopes;
|
||||
- (void)enableSignInSettings:(BOOL)enable;
|
||||
- (void)reportAuthStatus;
|
||||
- (void)retrieveUserInfo;
|
||||
@end
|
||||
|
||||
@implementation GooglePlusSampleSignInViewController
|
||||
|
||||
@synthesize signInButton = signInButton_;
|
||||
@synthesize signInAuthStatus = signInAuthStatus_;
|
||||
@synthesize signInDisplayName = signInDisplayName_;
|
||||
@synthesize signOutButton = signOutButton_;
|
||||
@synthesize plusMomentsWriteScope = plusMomentsWriteScope_;
|
||||
@synthesize userinfoEmailScope = userinfoEmailScope_;
|
||||
|
||||
- (void)dealloc {
|
||||
[signInButton_ release];
|
||||
[signInAuthStatus_ release];
|
||||
[signInDisplayName_ release];
|
||||
[signOutButton_ release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark - View lifecycle
|
||||
|
||||
- (void)reportAuthStatus {
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
if (appDelegate.auth) {
|
||||
signInAuthStatus_.text = @"Status: Authenticated";
|
||||
} else {
|
||||
// To authenticate, use Google+ sign-in button.
|
||||
signInAuthStatus_.text = @"Status: Not authenticated";
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
plusMomentsWriteScope_.on = appDelegate.plusMomentsWriteScope;
|
||||
userinfoEmailScope_.on = savedUserinfoEmailScopeState_;
|
||||
|
||||
// Set up sign-out button.
|
||||
[[signOutButton_ layer] setCornerRadius:5];
|
||||
[[signOutButton_ layer] setMasksToBounds:YES];
|
||||
@@ -60,27 +74,28 @@
|
||||
|
||||
// Set up sample view of Google+ sign-in.
|
||||
signInButton_.delegate = self;
|
||||
signInButton_.shouldFetchGoogleUserEmail = userinfoEmailScope_.on;
|
||||
signInButton_.clientID = [GooglePlusSampleAppDelegate clientID];
|
||||
signInButton_.scope = [NSArray arrayWithObjects:
|
||||
@"https://www.googleapis.com/auth/plus.moments.write",
|
||||
@"https://www.googleapis.com/auth/plus.me",
|
||||
nil];
|
||||
[self setSignInScopes];
|
||||
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
appDelegate.signInButton = signInButton_;
|
||||
[self reportAuthStatus];
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
appDelegate.plusMomentsWriteScope = plusMomentsWriteScope_.on;
|
||||
savedUserinfoEmailScopeState_ = userinfoEmailScope_.on;
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
appDelegate.signInButton = nil;
|
||||
[super viewDidUnload];
|
||||
}
|
||||
|
||||
#pragma mark - GooglePlusSignInDelegate
|
||||
#pragma mark - GPPSignInDelegate
|
||||
|
||||
- (void)finishedWithAuth:(GTMOAuth2Authentication *)auth
|
||||
error:(NSError *)error {
|
||||
@@ -89,22 +104,78 @@
|
||||
[NSString stringWithFormat:@"Status: Authentication error: %@", error];
|
||||
return;
|
||||
}
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
appDelegate.auth = auth;
|
||||
[self reportAuthStatus];
|
||||
}
|
||||
|
||||
#pragma mark - Helper methods
|
||||
|
||||
- (GooglePlusSampleAppDelegate *)appDelegate {
|
||||
return (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
}
|
||||
|
||||
- (void)setSignInScopes {
|
||||
signInButton_.scope = plusMomentsWriteScope_.on ?
|
||||
[NSArray arrayWithObjects:
|
||||
@"https://www.googleapis.com/auth/plus.moments.write",
|
||||
@"https://www.googleapis.com/auth/plus.me",
|
||||
nil] :
|
||||
[NSArray arrayWithObjects:
|
||||
@"https://www.googleapis.com/auth/plus.me",
|
||||
nil];
|
||||
}
|
||||
|
||||
- (void)enableSignInSettings:(BOOL)enable {
|
||||
plusMomentsWriteScope_.enabled = enable;
|
||||
userinfoEmailScope_.enabled = enable && !plusMomentsWriteScope_.on;
|
||||
}
|
||||
|
||||
- (void)reportAuthStatus {
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
if (appDelegate.auth) {
|
||||
signInAuthStatus_.text = @"Status: Authenticated";
|
||||
[self retrieveUserInfo];
|
||||
[self enableSignInSettings:NO];
|
||||
} else {
|
||||
// To authenticate, use Google+ sign-in button.
|
||||
signInAuthStatus_.text = @"Status: Not authenticated";
|
||||
[self enableSignInSettings:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)retrieveUserInfo {
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
if (appDelegate.auth.userEmail) {
|
||||
signInDisplayName_.text = appDelegate.auth.userEmail;
|
||||
} else {
|
||||
signInDisplayName_.text = @"";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - IBActions
|
||||
|
||||
- (IBAction)signOut:(id)sender {
|
||||
[[signInButton_ googlePlusSignIn] signOut];
|
||||
|
||||
GooglePlusSampleAppDelegate *appDelegate = (GooglePlusSampleAppDelegate *)
|
||||
[[UIApplication sharedApplication] delegate];
|
||||
GooglePlusSampleAppDelegate *appDelegate = [self appDelegate];
|
||||
appDelegate.auth = nil;
|
||||
|
||||
[self reportAuthStatus];
|
||||
signInDisplayName_.text = @"";
|
||||
}
|
||||
|
||||
- (IBAction)plusMomentsWriteScopeToggle:(id)sender {
|
||||
[self setSignInScopes];
|
||||
userinfoEmailScope_.enabled = !plusMomentsWriteScope_.on;
|
||||
if (plusMomentsWriteScope_.on) {
|
||||
userinfoEmailScope_.on = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)userinfoEmailScopeToggle:(id)sender {
|
||||
signInButton_.shouldFetchGoogleUserEmail = userinfoEmailScope_.on;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -1,20 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1280</int>
|
||||
<string key="IBDocument.SystemVersion">10K549</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.36</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<int key="IBDocument.SystemTarget">1536</int>
|
||||
<string key="IBDocument.SystemVersion">12C54</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2843</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">933</string>
|
||||
<string key="NS.object.0">1929</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBUISwitch</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
@@ -39,7 +40,7 @@
|
||||
<object class="IBUIButton" id="306965198">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{19, 93}, {119, 35}}</string>
|
||||
<string key="NSFrame">{{19, 218}, {119, 35}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="419255470"/>
|
||||
@@ -77,7 +78,7 @@
|
||||
<object class="IBUIView" id="984977003">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{18, 34}, {118, 32}}</string>
|
||||
<string key="NSFrame">{{18, 159}, {118, 32}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="306965198"/>
|
||||
@@ -93,33 +94,144 @@
|
||||
<object class="IBUILabel" id="419255470">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrame">{{20, 163}, {280, 21}}</string>
|
||||
<string key="NSFrame">{{20, 288}, {280, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<reference key="NSNextKeyView" ref="534305484"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Status:</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<object class="NSColor" key="IBUITextColor" id="515161017">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">13</float>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="136904364">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">17</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<object class="NSFont" key="IBUIFont" id="445796440">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="534305484">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrame">{{20, 317}, {280, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="11644204"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<reference key="IBUITextColor" ref="515161017"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">13</float>
|
||||
<reference key="IBUIFontDescription" ref="136904364"/>
|
||||
<reference key="IBUIFont" ref="445796440"/>
|
||||
</object>
|
||||
<object class="IBUISwitch" id="167649888">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{191, 99}, {94, 27}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="175024995"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<bool key="IBUIOn">YES</bool>
|
||||
</object>
|
||||
<object class="IBUILabel" id="11644204">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{18, 20}, {273, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="929313605"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Scopes setting (sign out to change)</string>
|
||||
<reference key="IBUITextColor" ref="515161017"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">0</int>
|
||||
<reference key="IBUIFontDescription" ref="136904364"/>
|
||||
<reference key="IBUIFont" ref="445796440"/>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
|
||||
</object>
|
||||
<object class="IBUILabel" id="929313605">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 99}, {177, 27}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="167649888"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">plus.moments.write</string>
|
||||
<reference key="IBUITextColor" ref="515161017"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">0</int>
|
||||
<reference key="IBUIFontDescription" ref="136904364"/>
|
||||
<reference key="IBUIFont" ref="445796440"/>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
|
||||
</object>
|
||||
<object class="IBUILabel" id="175024995">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{19, 58}, {178, 27}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="300876298"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">userinfo.email</string>
|
||||
<reference key="IBUITextColor" ref="515161017"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">0</int>
|
||||
<reference key="IBUIFontDescription" ref="136904364"/>
|
||||
<reference key="IBUIFont" ref="445796440"/>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
|
||||
</object>
|
||||
<object class="IBUISwitch" id="300876298">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{191, 58}, {94, 27}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIEnabled">NO</bool>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
@@ -168,6 +280,30 @@
|
||||
</object>
|
||||
<int key="connectionID">24</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">signInDisplayName</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="534305484"/>
|
||||
</object>
|
||||
<int key="connectionID">28</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">plusMomentsWriteScope</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="167649888"/>
|
||||
</object>
|
||||
<int key="connectionID">35</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">userinfoEmailScope</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="300876298"/>
|
||||
</object>
|
||||
<int key="connectionID">39</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">signOut:</string>
|
||||
@@ -177,6 +313,24 @@
|
||||
</object>
|
||||
<int key="connectionID">26</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">plusMomentsWriteScopeToggle:</string>
|
||||
<reference key="source" ref="167649888"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">13</int>
|
||||
</object>
|
||||
<int key="connectionID">36</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">userinfoEmailScopeToggle:</string>
|
||||
<reference key="source" ref="300876298"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">13</int>
|
||||
</object>
|
||||
<int key="connectionID">40</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
@@ -193,6 +347,12 @@
|
||||
<reference ref="306965198"/>
|
||||
<reference ref="984977003"/>
|
||||
<reference ref="419255470"/>
|
||||
<reference ref="167649888"/>
|
||||
<reference ref="929313605"/>
|
||||
<reference ref="300876298"/>
|
||||
<reference ref="175024995"/>
|
||||
<reference ref="11644204"/>
|
||||
<reference ref="534305484"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
@@ -222,6 +382,36 @@
|
||||
<reference key="object" ref="419255470"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">27</int>
|
||||
<reference key="object" ref="534305484"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">29</int>
|
||||
<reference key="object" ref="167649888"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">30</int>
|
||||
<reference key="object" ref="11644204"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">34</int>
|
||||
<reference key="object" ref="929313605"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">37</int>
|
||||
<reference key="object" ref="175024995"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">38</int>
|
||||
<reference key="object" ref="300876298"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -231,26 +421,108 @@
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="30.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="34.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="37.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="38.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="0.0" key="6.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="7.CustomClassName">GooglePlusSignInButton</string>
|
||||
<string key="7.CustomClassName">GPPSignInButton</string>
|
||||
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">26</int>
|
||||
<int key="maxID">40</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">GPPSignInButton</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/GPPSignInButton.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">GooglePlusSampleSignInViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="plusMomentsWriteScopeToggle:">id</string>
|
||||
<string key="signOut:">id</string>
|
||||
<string key="userinfoEmailScopeToggle:">id</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="actionInfosByName">
|
||||
<object class="IBActionInfo" key="plusMomentsWriteScopeToggle:">
|
||||
<string key="name">plusMomentsWriteScopeToggle:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="signOut:">
|
||||
<string key="name">signOut:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="userinfoEmailScopeToggle:">
|
||||
<string key="name">userinfoEmailScopeToggle:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="plusMomentsWriteScope">UISwitch</string>
|
||||
<string key="signInAuthStatus">UILabel</string>
|
||||
<string key="signInButton">GPPSignInButton</string>
|
||||
<string key="signInDisplayName">UILabel</string>
|
||||
<string key="signOutButton">UIButton</string>
|
||||
<string key="userinfoEmailScope">UISwitch</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<object class="IBToOneOutletInfo" key="plusMomentsWriteScope">
|
||||
<string key="name">plusMomentsWriteScope</string>
|
||||
<string key="candidateClassName">UISwitch</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="signInAuthStatus">
|
||||
<string key="name">signInAuthStatus</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="signInButton">
|
||||
<string key="name">signInButton</string>
|
||||
<string key="candidateClassName">GPPSignInButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="signInDisplayName">
|
||||
<string key="name">signInDisplayName</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="signOutButton">
|
||||
<string key="name">signOutButton</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="userinfoEmailScope">
|
||||
<string key="name">userinfoEmailScope</string>
|
||||
<string key="candidateClassName">UISwitch</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/GooglePlusSampleSignInViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1536" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<string key="NS.key.0">button_background.png</string>
|
||||
<string key="NS.object.0">{1, 1}</string>
|
||||
</object>
|
||||
<string key="IBCocoaTouchPluginVersion">933</string>
|
||||
<string key="IBCocoaTouchPluginVersion">1929</string>
|
||||
</data>
|
||||
</archive>
|
||||
|
Reference in New Issue
Block a user