mirror of
https://bitbucket.org/vendoo/vendoo_v1.0.git
synced 2025-12-25 11:47:40 +00:00
Merged branch RDB-Dismiss-Ebay-Auth-Webview into Rapid-Dev-Branch
This commit is contained in:
commit
286c9361f5
Binary file not shown.
@ -90,11 +90,11 @@
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/EbayWebServiceManager.swift"
|
||||
timestampString = "494390858.671323"
|
||||
timestampString = "494685275.012942"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "568"
|
||||
endingLineNumber = "568">
|
||||
startingLineNumber = "573"
|
||||
endingLineNumber = "573">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
@ -104,11 +104,11 @@
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Vendoo/EbayWebServiceManager.swift"
|
||||
timestampString = "494391829.589686"
|
||||
timestampString = "494685275.012942"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "566"
|
||||
endingLineNumber = "566">
|
||||
startingLineNumber = "571"
|
||||
endingLineNumber = "571">
|
||||
</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) -> ()"
|
||||
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) -> ()).(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) -> ()).(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) -> ()).(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 = "494685275.012942"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "411"
|
||||
endingLineNumber = "411"
|
||||
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 = "494685275.012942"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "309"
|
||||
endingLineNumber = "309"
|
||||
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 = "494685275.012942"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "473"
|
||||
endingLineNumber = "473"
|
||||
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>
|
||||
|
||||
@ -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,18 +134,21 @@ 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)
|
||||
|
||||
|
||||
}
|
||||
|
||||
func deauthorizeApp(){
|
||||
let soapMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
||||
//@TODO: Add an alert to let user know if their account has not been deauthorized and keep them logged in.
|
||||
var soapMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
||||
"<RevokeTokenRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">" +
|
||||
"<RequesterCredentials>" +
|
||||
"<eBayAuthToken>\(self.xmlResponseDictionary["eBayAuthToken"])</eBayAuthToken>" +
|
||||
"</RequesterCredentials></RevokeTokenRequest>"
|
||||
"<eBayAuthToken>\(self.xmlResponseDictionary["eBayAuthToken"]!)</eBayAuthToken>" +
|
||||
"</RequesterCredentials>"
|
||||
soapMessage = soapMessage + "<ErrorLanguage>en_US</ErrorLanguage>" +
|
||||
"<WarningLevel>High</WarningLevel></RevokeTokenRequest>"
|
||||
|
||||
let url = NSURL(string: self.baseURL)
|
||||
let theRequest = NSMutableURLRequest(URL: url!)
|
||||
@ -303,7 +307,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 +408,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 +470,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
|
||||
/*
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user