Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Zak  
View profile  
 More options Jul 18 2012, 7:39 am
From: Zak <zakdan...@gmail.com>
Date: Wed, 18 Jul 2012 04:39:07 -0700 (PDT)
Local: Wed, Jul 18 2012 7:39 am
Subject: Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view

How can I adapt or subclass GTMOAuth2ViewControllerTouch to use as a modal
view? Currently I have it opening ok, but it fails at a few key places (for
example, it doesn't auto-close when it reaches the authorization success
page.). What steps do I need to take to make it work as a modal view?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
☃ David Phillip Oster  
View profile  
 More options Jul 18 2012, 1:46 pm
From: David Phillip Oster (☃) <os...@google.com>
Date: Wed, 18 Jul 2012 10:46:16 -0700
Local: Wed, Jul 18 2012 1:46 pm
Subject: Re: Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view

Where the sample app calls:

  [[self navigationController] pushViewController:viewController
animated:YES];

instead call:

   MyNavigationController *presentModal = [[[MyNavigationController alloc]
initWithRootViewController:viewController] autorelease];

  [presentModal setDismisser:self];

  UIBarButtonItem *cancelButton = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self
action:@selector(doDismiss)] autorelease];

  [[viewController navigationItem] setLeftBarButtonItem:cancelButton];

  [[self navigationController] presentModalViewController:presentModal
animated:YES];

where doDismiss is:

- (void)doDismiss {

  [self dismissModalViewControllerAnimated:YES];

}

that handles showing and canceling.

For auto-dismiss, we catch the pop that the OAuth2ViewController will do:

@interface MyNavigationController : UINavigationController
@property (nonatomic, assign) UIViewController *dismisser;
- (UIViewController *)popViewControllerAnimated:(BOOL)animated;
@end
@implementation MyNavigationController
@synthesize dismisser;
- (UIViewController *)popViewControllerAnimated:(BOOL)animated {
  if ([[self viewControllers] count] <= 1) {
    UIViewController *result = [[[self topViewController] retain]
autorelease];
    [dismisser dismissModalViewControllerAnimated:YES];
    return result;
  } else {
    return [super popViewControllerAnimated:animated];
  }

}

@end

Warning: I didn't actually try the auto-dismiss case.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Robbins  
View profile  
 More options Jul 28 2012, 2:21 am
From: Greg Robbins <grobb...@google.com>
Date: Fri, 27 Jul 2012 23:21:59 -0700
Local: Sat, Jul 28 2012 2:21 am
Subject: Re: Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view

We have recently added a property to the gtm-oauth2 iOS view controller,
popViewBlock, which is a block the app can set that will be called when the
view should be removed. You may find that helpful.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yaniv Mesika  
View profile  
 More options Aug 9 2012, 3:05 pm
From: Yaniv Mesika <yaniv.mes...@gmail.com>
Date: Thu, 9 Aug 2012 12:05:24 -0700 (PDT)
Local: Thurs, Aug 9 2012 3:05 pm
Subject: Re: Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view

Can you please explain in short how to use the popViewBlock property ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Shafer  
View profile  
 More options Oct 30 2012, 2:25 pm
From: Joel Shafer <joels...@gmail.com>
Date: Tue, 30 Oct 2012 11:25:38 -0700 (PDT)
Local: Tues, Oct 30 2012 2:25 pm
Subject: Re: Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view

We are using this code to push a NavController to simulate a modal OAuth
dialog.  The problem that we experience with this is that after the user
successfully signs in the screen turns  black and remains for several
moments before NavController is dismissed.  Is this a known issue?  Any
workarounds available?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Robbins  
View profile  
 More options Oct 30 2012, 4:40 pm
From: Greg Robbins <grobb...@google.com>
Date: Tue, 30 Oct 2012 13:40:22 -0700
Local: Tues, Oct 30 2012 4:40 pm
Subject: Re: Using GTMOAuth2ViewControllerTouch as a modal view instead of pushing it as a navcontroller view

The popViewBlock should be called immediately and
the kGTMOAuth2UserSignedIn notification posted as the controller detects
the server's end-of-sign-in signals.

It may take longer for the completion handler for auth to be called, as
additional fetches are needed to obtain an access token and, for Google
sign-ins, the user's email address.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »