Update Google+ integration.
[UPDATED] Google+ SDK to 1.1.0.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user