Regarding G + docs here: https://developers.google.com/+/mobile/ios/sign-in
The login button can be added using XIB or programmatically in the UIViewController.
I have a TableViewController, and I'm going to add a G + Signin button as an auxiliary representation of a table row:
subtitleCell.accessoryView = self.googlePlusSignInButton;
where the enter button will be initialized as follows:
-(void) setGooglePlusButtons { self.googlePlusSignInButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; UIImage *backgroundButtonImage = [UIImage imageNamed:@"bt_search_cancel.png"]; googlePlusSignInButton_.frame = CGRectMake(0.0f, 0.0f, backgroundButtonImage.size.width, backgroundButtonImage.size.height); googlePlusSignInButton_.titleLabel.textColor = [UIColor whiteColor]; googlePlusSignInButton_.titleLabel.font = [UIFont boldSystemFontOfSize:11.0f]; googlePlusSignInButton_.titleLabel.numberOfLines = 2; googlePlusSignInButton_.titleLabel.shadowColor = [UIColor darkGrayColor]; googlePlusSignInButton_.titleLabel.shadowOffset = CGSizeMake(0.0f, -1.0f); [googlePlusSignInButton_ setTitle:NSLocalizedString(@"UI_BUTTONS_LOGIN", @"") forState:UIControlStateNormal]; [googlePlusSignInButton_ setBackgroundImage:backgroundButtonImage forState:UIControlStateNormal];
The button is set to viewDidLoad:
- (void)viewDidLoad { [super viewDidLoad]; [self setGooglePlusButtons];
UIViewControlled has an interface for the signin delegate:
@interface MXMSettingsTableViewController () <GPPSignInDelegate> @end
It seems that the delegate is not being called or the button with the common sign is not associated with the controller instance:
// GPPSignInDelegate - (void)finishedWithAuth:(GTMOAuth2Authentication *)auth error:(NSError *)error { ///.... }
I suppose that
binds an instance button to a ViewController:
// The button that handles Google+ sign-in. @property (retain, nonatomic) GPPSignInButton *googlePlusSignInButton;
but something is wrong with this implementation, I canβt understand.
ios google-plus
loretoparisi
source share