Can now dismiss ebay webview, but for some reason auth is acting inconsistent could be a problem with the server itself, will wait to merge this branch and check on 09/05/16

This commit is contained in:
Okechi Onyeje 2016-09-03 19:20:15 -04:00
parent d4f901a084
commit 8e2e94313b
4 changed files with 229 additions and 18 deletions

View File

@ -90,11 +90,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EbayWebServiceManager.swift"
timestampString = "494390858.671323"
timestampString = "494636868.104791"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "568"
endingLineNumber = "568">
startingLineNumber = "570"
endingLineNumber = "570">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -104,11 +104,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EbayWebServiceManager.swift"
timestampString = "494391829.589686"
timestampString = "494636868.104791"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "566"
endingLineNumber = "566">
startingLineNumber = "568"
endingLineNumber = "568">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -175,5 +175,197 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "494635088.267954"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "788"
endingLineNumber = "788"
landmarkName = "toggleAuth(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.toggleAuth (__ObjC.UIButton) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "494637260.284101"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "788"
endingLineNumber = "788"
offsetFromSymbolStart = "1462">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.(toggleAuth (__ObjC.UIButton) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/usr/include/dispatch/queue.h"
timestampString = "494637260.284213"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "325"
endingLineNumber = "325"
offsetFromSymbolStart = "44">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "494636143.418834"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "791"
endingLineNumber = "791"
landmarkName = "toggleAuth(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.(toggleAuth (__ObjC.UIButton) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "494637260.28507"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "791"
endingLineNumber = "791"
offsetFromSymbolStart = "64">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.(toggleAuth (__ObjC.UIButton) -&gt; ()).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "494637260.285178"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "792"
endingLineNumber = "792"
offsetFromSymbolStart = "34">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EbayWebServiceManager.swift"
timestampString = "494636868.104791"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "408"
endingLineNumber = "408"
landmarkName = "parser(_:foundCharacters:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "494636097.069833"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "764"
endingLineNumber = "764"
landmarkName = "webViewDidFinishLoad(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EbayWebServiceManager.swift"
timestampString = "494636868.104791"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "306"
endingLineNumber = "306"
landmarkName = "fetchToken()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "494636370.565199"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "793"
endingLineNumber = "793"
landmarkName = "toggleAuth(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/EbayWebServiceManager.swift"
timestampString = "494637258.536031"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "470"
endingLineNumber = "470"
landmarkName = "parser(_:foundCharacters:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "494637280.732776"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "765"
endingLineNumber = "765"
landmarkName = "webViewDidFinishLoad(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -40,6 +40,7 @@ class EbayWebServiceManager: NSObject {
private var completion: ServiceResponse!
private var isGettingSubCategories: Bool = false
private var isRevisingListing: Bool = false
private var requestGroup: dispatch_group_t = dispatch_group_create()
//---------------------------------------------//
@ -123,7 +124,7 @@ extension EbayWebServiceManager {
}
}
func authorizeApp(){
func authorizeApp(onComplete: ServiceResponse){
let soapMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<GetSessionIDRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">" +
@ -133,7 +134,7 @@ extension EbayWebServiceManager {
let url = NSURL(string: self.baseURL)
let theRequest = NSMutableURLRequest(URL: url!)
theRequest.addValue("GetSessionID", forHTTPHeaderField: "X-EBAY-API-CALL-NAME")
self.completion = onComplete
self.requestMaker(soapMessage, theRequest: theRequest)
@ -303,7 +304,7 @@ extension EbayWebServiceManager {
let url = NSURL(string: self.baseURL)
let theRequest = NSMutableURLRequest(URL: url!)
theRequest.addValue("FetchToken", forHTTPHeaderField: "X-EBAY-API-CALL-NAME")
//dispatch_group_enter(self.requestGroup)
self.requestMaker(soapMessage, theRequest: theRequest)
}
@ -404,6 +405,7 @@ extension EbayWebServiceManager: NSXMLParserDelegate {
print("account credentials saved")
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "ebayAuthorized")
self.isAuthorized = true
//self.completion(nil, nil)
//Test authentication
let soapmessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
@ -465,7 +467,7 @@ extension EbayWebServiceManager: NSXMLParserDelegate {
let url = NSURL(string: self.baseURL)
let theRequest = NSMutableURLRequest(URL: url!)
theRequest.addValue("GetCategories", forHTTPHeaderField: "X-EBAY-API-CALL-NAME")
self.completion(nil, nil)
self.requestMaker(soapmessage, theRequest: theRequest)
break
/*

View File

@ -726,10 +726,19 @@ extension NetworksTableViewController: UITableViewDelegate {
extension NetworksTableViewController: EbayWebServiceManagerDelegate {
func signInUser(signInString : String!) {
let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
let mywebViewController = UIViewController()
//let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
let myWebView = UIWebView(frame: mywebViewController.view.bounds)
myWebView.delegate = self
myWebView.loadRequest(NSURLRequest(URL: NSURL(string: signInString)!))
self.view.addSubview(myWebView)
mywebViewController.view = myWebView
let navController = UINavigationController(rootViewController: mywebViewController)
mywebViewController.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Done, target: self, action: Selector("dismiss"))
self.presentViewController(navController, animated: true, completion: nil)
//self.view.addSubview(myWebView)
}
}
@ -761,6 +770,10 @@ extension NetworksTableViewController: UIWebViewDelegate {
}
func dismiss() {
self.dismissViewControllerAnimated(true, completion: nil)
}
}
extension NetworksTableViewController {
@ -772,12 +785,16 @@ extension NetworksTableViewController {
switch (sender.superview?.superview?.classForCoder){
case is EbayTableViewCell.Type:
let tabBar = self.tabBarController
((tabBar as? HomeViewController)?.ebayGraphManager.authorizeApp())!
((tabBar as? HomeViewController)?.ebayGraphManager.authorizeApp({
something,_ -> Void in
// // //
dispatch_async(dispatch_get_main_queue(), {
sender.setTitle("Logout", forState: UIControlState.Normal)
(sender.superview?.superview as! EbayTableViewCell).settingsBtn.enabled = true
(sender.superview?.superview as! EbayTableViewCell).settingsBtn.hidden = false
})
}))!
break
case is AmazonTableViewCell.Type:
break