Permalink
Browse files

OAuth seems to be working properly and hiding view once done

  • Loading branch information...
1 parent ae3f366 commit 4d29cc321dde30cd839a870a1b6af36681fb37bf @davidchiles committed Feb 16, 2012
View
@@ -26,6 +26,8 @@
#define GTMOAUTHAUTHENTICATION_DEFINE_GLOBALS 1
#import "GTMOAuthAuthentication.h"
+#define GTL_DEBUG_OAUTH_SIGNING 1
+
// standard OAuth keys
static NSString *const kOAuthConsumerKey = @"oauth_consumer_key";
static NSString *const kOAuthTokenKey = @"oauth_token";
View
@@ -316,6 +316,7 @@ - (BOOL)requestRedirectedToRequest:(NSURLRequest *)redirectedRequest {
}
// the callback page was requested, so tell the window to close
+ NSLog(@"closeTheWindow");
[self closeTheWindow];
// notify the app so it can put up a post-sign in, pre-access token fetch UI
@@ -75,6 +75,7 @@
63E4BF1A14E068EC00E0BD46 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 63E4BF1914E068EC00E0BD46 /* libz.dylib */; };
63E4BF3114E0728200E0BD46 /* NSDataAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E4BF2E14E0728200E0BD46 /* NSDataAdditions.m */; };
63E4BF3214E0728200E0BD46 /* TBXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E4BF3014E0728200E0BD46 /* TBXML.m */; };
+ 63E5B13614EDAF2E007E9BAF /* location.png in Resources */ = {isa = PBXBuildFile; fileRef = 63E5B13514EDAF2E007E9BAF /* location.png */; };
63FFDC6614E480DF00701DEC /* OPETagInterpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FFDC6514E480DF00701DEC /* OPETagInterpreter.m */; };
/* End PBXBuildFile section */
@@ -321,6 +322,7 @@
63E4BF2E14E0728200E0BD46 /* NSDataAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDataAdditions.m; sourceTree = "<group>"; };
63E4BF2F14E0728200E0BD46 /* TBXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBXML.h; sourceTree = "<group>"; };
63E4BF3014E0728200E0BD46 /* TBXML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBXML.m; sourceTree = "<group>"; };
+ 63E5B13514EDAF2E007E9BAF /* location.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = location.png; sourceTree = "<group>"; };
63FFDC6414E480DF00701DEC /* OPETagInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OPETagInterpreter.h; path = ../OPETagInterpreter.h; sourceTree = "<group>"; };
63FFDC6514E480DF00701DEC /* OPETagInterpreter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OPETagInterpreter.m; path = ../OPETagInterpreter.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -617,6 +619,7 @@
637A89FB14E1B426003F656F /* Resources */ = {
isa = PBXGroup;
children = (
+ 63E5B13514EDAF2E007E9BAF /* location.png */,
6345E57B14E2FD1200F55486 /* Blue_Dot.png */,
63E279EF14E2073C009D02BD /* Blue_Marker.png */,
637A89FD14E1C340003F656F /* SPOI.bundle */,
@@ -841,6 +844,7 @@
63CB49E314E9E3BF008C4551 /* OPETypeViewController.xib in Resources */,
6383948214EC4DDD00C74A57 /* OPEInfoViewController.xib in Resources */,
6383949814EC7DAC00C74A57 /* GTMOAuthViewTouch.xib in Resources */,
+ 63E5B13614EDAF2E007E9BAF /* location.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -15,8 +15,10 @@
- (IBAction)doneButtonPressed:(id)sender;
- (IBAction)loginButtonPressed:(id)sender;
+- (IBAction)logoutButtonPressed:(id)sender;
- (void) signInToOSM;
- (GTMOAuthAuthentication *)osmAuth;
+- (void) signOutOfOSM;
@end
@@ -50,6 +50,12 @@ - (IBAction)loginButtonPressed:(id)sender
[self signInToOSM];
}
+- (IBAction)logoutButtonPressed:(id)sender
+{
+ NSLog(@"Logout Button Pressed");
+ [self signOutOfOSM];
+}
+
- (void)viewController:(GTMOAuthViewControllerTouch *)viewController
finishedWithAuth:(GTMOAuthAuthentication *)auth
error:(NSError *)error {
@@ -125,7 +131,7 @@ - (void)signInToOSM {
// finished or been canceled
//
// This URL does not need to be for an actual web page
- [auth setCallback:@"http://www.dbro.pro"];
+ [auth setCallback:@"http://www.google.com/OAuthCallback"];
// Display the autentication view
GTMOAuthViewControllerTouch *viewController;
@@ -144,6 +150,10 @@ - (void)signInToOSM {
animated:YES];
}
+- (void) signOutOfOSM
+{
+ [GTMOAuthViewControllerTouch removeParamsFromKeychainForName:@"OSMPOIEditor"];
+}
#pragma mark - View lifecycle
@@ -41,7 +41,7 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{124, 324}, {73, 38}}</string>
<reference key="NSSuperview" ref="191373211"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="850409258"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -74,9 +74,9 @@
<object class="IBUITextView" id="834147376">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{40, 67}, {240, 249}}</string>
+ <string key="NSFrame">{{40, 67}, {240, 141}}</string>
<reference key="NSSuperview" ref="191373211"/>
- <reference key="NSNextKeyView" ref="566263014"/>
+ <reference key="NSNextKeyView" ref="376170541"/>
<string key="NSReuseIdentifierKey">_NS:639</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
@@ -105,6 +105,7 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{124, 370}, {72, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -118,20 +119,42 @@
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="996025652"/>
- <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <object class="IBUIFontDescription" key="IBUIFontDescription" id="250430783">
<int key="type">2</int>
<double key="pointSize">15</double>
</object>
- <object class="NSFont" key="IBUIFont">
+ <object class="NSFont" key="IBUIFont" id="943719583">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
+ <object class="IBUIButton" id="376170541">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{123, 279}, {75, 37}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView" ref="566263014"/>
+ <string key="NSReuseIdentifierKey">_NS:225</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Logout</string>
+ <reference key="IBUIHighlightedTitleColor" ref="423514918"/>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <reference key="IBUINormalTitleShadowColor" ref="996025652"/>
+ <reference key="IBUIFontDescription" ref="250430783"/>
+ <reference key="IBUIFont" ref="943719583"/>
+ </object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="834147376"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@@ -179,6 +202,15 @@
</object>
<int key="connectionID">22</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">logoutButtonPressed:</string>
+ <reference key="source" ref="376170541"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">24</int>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -195,6 +227,7 @@
<reference ref="566263014"/>
<reference ref="834147376"/>
<reference ref="850409258"/>
+ <reference ref="376170541"/>
</array>
<reference key="parent" ref="0"/>
</object>
@@ -224,6 +257,11 @@
<reference key="object" ref="850409258"/>
<reference key="parent" ref="191373211"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="376170541"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -234,14 +272,15 @@
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0" key="4.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">22</int>
+ <int key="maxID">24</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
@@ -75,7 +75,7 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{290, 13}, {18, 19}}</string>
<reference key="NSSuperview" ref="595202461"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:225</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -108,16 +108,19 @@
</array>
<string key="NSFrame">{{0, 372}, {320, 44}}</string>
<reference key="NSSuperview" ref="817414081"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="852049806"/>
<string key="NSReuseIdentifierKey">_NS:371</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<array class="NSMutableArray" key="IBUIItems">
<object class="IBUIBarButtonItem" id="135252546">
- <string key="IBUITitle">Location</string>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">location.png</string>
+ </object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <int key="IBUIStyle">1</int>
<reference key="IBUIToolbar" ref="595202461"/>
</object>
<object class="IBUIBarButtonItem" id="885040991">
@@ -145,6 +148,7 @@
</array>
<string key="NSFrameSize">{320, 416}</string>
<reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="595202461"/>
<string key="NSReuseIdentifierKey">_NS:196</string>
<object class="NSColor" key="IBUIBackgroundColor">
@@ -159,6 +163,7 @@
</array>
<string key="NSFrame">{{0, 64}, {320, 416}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="817414081"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@@ -170,6 +175,7 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUINavigationItem" key="IBUINavigationItem" id="549989894">
+ <reference key="IBUINavigationBar"/>
<string key="IBUITitle">Root View Controller</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
@@ -396,11 +402,77 @@
<nil key="sourceID"/>
<int key="maxID">65</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes"/>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">OPEViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="addPointButtonPressed:">id</string>
+ <string key="infoButtonPressed:">id</string>
+ <string key="locationButtonPressed:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="addPointButtonPressed:">
+ <string key="name">addPointButtonPressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="infoButtonPressed:">
+ <string key="name">infoButtonPressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="locationButtonPressed:">
+ <string key="name">locationButtonPressed:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="addOPEPoint">UIBarButtonItem</string>
+ <string key="infoButton">UIButton</string>
+ <string key="location">UIBarButtonItem</string>
+ <string key="mapView">RMMapView</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="addOPEPoint">
+ <string key="name">addOPEPoint</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="infoButton">
+ <string key="name">infoButton</string>
+ <string key="candidateClassName">UIButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="location">
+ <string key="name">location</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="mapView">
+ <string key="name">mapView</string>
+ <string key="candidateClassName">RMMapView</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/OPEViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">RMMapView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/RMMapView.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <string key="NS.key.0">location.png</string>
+ <string key="NS.object.0">{20, 20}</string>
+ </object>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d29cc3

Please sign in to comment.