Black Screen when authetication is completed

25 views
Skip to first unread message

David Lam

unread,
Jun 8, 2015, 2:48:35 AM6/8/15
to gtm-o...@googlegroups.com
Hi guys,

I'm working on an iphone project using gtm-oauth2 from cocoa pods.

I have a strange issue where there is a black screen when my authetication is completed. The data flow (ie authToken) and everything works as expected downstream.

General approach: 
1. Instantiate GTMOAuth2ViewControllerTouch controller.
2. Config
3. push on top of existing controller

Symptoms:
1. Right before completion handler is called, there is a black border for a split second as shown in the video
2. This does not happen if I were to present the GTMOAuth2ViewControllerTouch controller instead of pushing it on top of the navigation stack
func startGetAuthToken() {
let oauthViewController : GTMOAuth2ViewControllerTouch = GTMOAuth2ViewControllerTouch.controllerWithScope ("https://mail.google.com/",
clientID: CLIENT_ID,
clientSecret: CLIENT_SECRET,
keychainItemName: keyChainForAccount,
completionHandler:
{ (viewController, retrievedAuth, error) -> Void in
if let error = error {
self.userClickedCancel()
} else {
self.navigationController?.navigationBarHidden = true
self.doneFetchingAuth(retrievedAuth)
}
 
}) as! GTMOAuth2ViewControllerTouch
oauthViewController.authentication.redirectURI = "http://localhost//maildough"
 
let barButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Cancel,
target: self,
action: "userClickedCancel")
barButtonItem.tintColor = UIColor.whiteColor()
oauthViewController.navigationItem.setLeftBarButtonItem(barButtonItem, animated: false)
self.navigationController?.pushViewController(oauthViewController, animated: false)
//Flag for some downstream operation
oauthViewControllerShown = true
}

https://gist.github.com/deltadavid/6fc4a33f669846aa7ab2

Any pointers will be greatly appreciated :D

Cheers
David
googleOauth2.mov
Reply all
Reply to author
Forward
0 new messages