FBAuthorization is done, but deauthorization is a little buggy due to threading will address later, starting item listing process

This commit is contained in:
Okechi Onyeje 2016-05-31 18:39:27 -04:00
parent d96813b297
commit 734bc8d26b
7 changed files with 387 additions and 246 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -10,27 +10,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift" filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.505474" timestampString = "486403080.878544"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "73" startingLineNumber = "35"
endingLineNumber = "73" endingLineNumber = "35"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227035.314411"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "27"
endingLineNumber = "27"
landmarkName = "FacebookGraphAPIManager" landmarkName = "FacebookGraphAPIManager"
landmarkType = "3"> landmarkType = "3">
<Locations> <Locations>
@ -38,16 +22,16 @@
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.isAuthorized.getter : Swift.Bool" symbolName = "Vendoo.FacebookGraphAPIManager.isAuthorized.setter : Swift.Bool"
moduleName = "Vendoo" moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes" usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.651867" timestampString = "486426967.061218"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "27" startingLineNumber = "35"
endingLineNumber = "27" endingLineNumber = "35"
offsetFromSymbolStart = "11"> offsetFromSymbolStart = "27">
</Location> </Location>
<Location <Location
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
@ -57,12 +41,12 @@
moduleName = "Vendoo" moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes" usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.652405" timestampString = "486426967.061401"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "27" startingLineNumber = "35"
endingLineNumber = "27" endingLineNumber = "35"
offsetFromSymbolStart = "196"> offsetFromSymbolStart = "584">
</Location> </Location>
</Locations> </Locations>
</BreakpointContent> </BreakpointContent>
@ -74,187 +58,187 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift" filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175" timestampString = "486403080.878544"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "59"
endingLineNumber = "59"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.653326"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "59"
endingLineNumber = "59"
offsetFromSymbolStart = "1287">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.653483"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "65"
endingLineNumber = "65"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.654376"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "1382">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.654535"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "64"
endingLineNumber = "64"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.655488"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "1382">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.655648"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "72"
endingLineNumber = "72"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227622.356175"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "63" startingLineNumber = "63"
endingLineNumber = "63" endingLineNumber = "63"
landmarkName = "authorizeApp(_:)" landmarkName = "authorizeApp(_:)"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486407553.29875"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "114"
endingLineNumber = "114"
landmarkName = "authorizeApp(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486407553.29875"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "139"
endingLineNumber = "139"
landmarkName = "makeGETRequest(_:params:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486407553.29875"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "146"
endingLineNumber = "146"
landmarkName = "makeGETRequest(_:params:)"
landmarkType = "5">
<Locations> <Locations>
<Location <Location
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.authorizeApp (__ObjC.UIViewController) -&gt; ()" symbolName = "Vendoo.FacebookGraphAPIManager.makeGETRequest (Swift.ImplicitlyUnwrappedOptional&lt;Swift.String&gt;, params : Swift.ImplicitlyUnwrappedOptional&lt;Swift.Dictionary&lt;__ObjC.NSObject, Swift.AnyObject&gt;&gt;) -&gt; Swift.Bool"
moduleName = "Vendoo" moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes" usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.656601" timestampString = "486426967.148932"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "72" startingLineNumber = "149"
endingLineNumber = "72" endingLineNumber = "149"
offsetFromSymbolStart = "1382"> offsetFromSymbolStart = "1020">
</Location> </Location>
<Location <Location
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; ()).(closure #1)" symbolName = "Vendoo.FacebookGraphAPIManager.(makeGETRequest (Swift.ImplicitlyUnwrappedOptional&lt;Swift.String&gt;, params : Swift.ImplicitlyUnwrappedOptional&lt;Swift.Dictionary&lt;__ObjC.NSObject, Swift.AnyObject&gt;&gt;) -&gt; Swift.Bool).(closure #1)"
moduleName = "Vendoo" moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes" usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227901.656721" timestampString = "486426967.149049"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "72" startingLineNumber = "149"
endingLineNumber = "72" endingLineNumber = "149"
offsetFromSymbolStart = "16"> offsetFromSymbolStart = "254">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486404728.171853"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "424"
endingLineNumber = "424"
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "486426967.178522"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "424"
endingLineNumber = "424"
offsetFromSymbolStart = "14599">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "486426967.179193"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "424"
endingLineNumber = "424"
offsetFromSymbolStart = "17180">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486403506.007886"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "149"
endingLineNumber = "149"
landmarkName = "tableView(_:cellForRowAtIndexPath:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.tableView (__ObjC.UITableView, cellForRowAtIndexPath : __ObjC.NSIndexPath) -&gt; __ObjC.UITableViewCell"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "486426967.180204"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "149"
endingLineNumber = "149"
offsetFromSymbolStart = "2553">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NetworksTableViewController.tableView (__ObjC.UITableView, cellForRowAtIndexPath : __ObjC.NSIndexPath) -&gt; __ObjC.UITableViewCell"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NetworksTableViewController.swift"
timestampString = "486426967.180347"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "149"
endingLineNumber = "149"
offsetFromSymbolStart = "3458">
</Location> </Location>
</Locations> </Locations>
</BreakpointContent> </BreakpointContent>
@ -266,13 +250,77 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift" filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486227898.081641" timestampString = "486407553.29875"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "74" startingLineNumber = "165"
endingLineNumber = "74" endingLineNumber = "165"
landmarkName = "makeDELETIONResquest(_:params:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NetworksTableViewController.swift"
timestampString = "486404876.015616"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "427"
endingLineNumber = "427"
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486407544.786775"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "97"
endingLineNumber = "97"
landmarkName = "authorizeApp(_:)" landmarkName = "authorizeApp(_:)"
landmarkType = "5"> landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; Swift.Bool).(closure #1).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486426967.190073"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "97"
endingLineNumber = "97"
offsetFromSymbolStart = "15">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(authorizeApp (__ObjC.UIViewController) -&gt; Swift.Bool).(closure #1).(closure #1).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "486426967.190291"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "100"
endingLineNumber = "100"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
</Breakpoints> </Breakpoints>

BIN
Vendoo/.DS_Store vendored

Binary file not shown.

View File

@ -12,12 +12,13 @@ import FBSDKCoreKit
import FBSDKLoginKit import FBSDKLoginKit
import AeroGearHttp import AeroGearHttp
import AeroGearOAuth2 import AeroGearOAuth2
//import OAuthSwift import OAuthSwift
import Locksmith
/* /*
NOTES: NOTES:
I am able to authorize application for use with facebook but cannot deathorize and completion block of authorization code is not being called -> need to figure this out I am able to authorize application for use with facebook and deauthorize it while showing the toggle button switching back and forth, but during the last step of the process, for some reason NSUserDefault key for fbauthorized is not being called, in response handler, may need to run in a different thread
*/ */
class FacebookGraphAPIManager: NSObject { class FacebookGraphAPIManager: NSObject {
@ -25,10 +26,12 @@ class FacebookGraphAPIManager: NSObject {
//----------------------------------------------// //----------------------------------------------//
static let sharedInstance = FacebookGraphAPIManager() static let sharedInstance = FacebookGraphAPIManager()
let graphBaseURL = "graph.facebook.com" let graphBaseURL = "https://graph.facebook.com/v2.2"
private var apiKey: String! private var apiKey: String!
private var apiSecret: String! private var apiSecret: String!
private var userEmail:String = (NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!
private let login: FBSDKLoginManager = FBSDKLoginManager()
var isAuthorized: Bool = NSUserDefaults.standardUserDefaults().boolForKey("fbAuthorized") var isAuthorized: Bool = NSUserDefaults.standardUserDefaults().boolForKey("fbAuthorized")
//---------------------------------------------// //---------------------------------------------//
@ -38,6 +41,14 @@ class FacebookGraphAPIManager: NSObject {
self.apiKey = ((dict["Facebook"] as! Dictionary<String, AnyObject>)["consumerKey"] as! String) self.apiKey = ((dict["Facebook"] as! Dictionary<String, AnyObject>)["consumerKey"] as! String)
self.apiSecret = ((dict["Facebook"] as! Dictionary<String, AnyObject>)["consumerSecret"] as! String) self.apiSecret = ((dict["Facebook"] as! Dictionary<String, AnyObject>)["consumerSecret"] as! String)
if(isAuthorized){
let dictionary = Locksmith.loadDataForUserAccount(self.userEmail, inService: "vendoo")
print("account credentials loaded")
//print((NSUserDefaults.standardUserDefaults().objectForKey("") as? FBSDKAccessToken!))
}
} }
} }
@ -48,64 +59,137 @@ class FacebookGraphAPIManager: NSObject {
//MARK: - OAuth Methods //MARK: - OAuth Methods
extension FacebookGraphAPIManager { extension FacebookGraphAPIManager {
func authorizeApp(viewcontroller: UIViewController){ func authorizeApp(viewcontroller: UIViewController) -> Bool{
let http = Http(baseURL: self.graphBaseURL) // [1] login.loginBehavior = FBSDKLoginBehavior.Web
let facebookConfig = FacebookConfig( // [2] if(!self.isAuthorized){
clientId: self.apiKey, if(FBSDKAccessToken.currentAccessToken() == nil){
clientSecret: self.apiSecret, var boolResult:Bool = false
scopes:["publish_actions"]) dispatch_async(dispatch_get_main_queue(), { () -> Void in
let oauth2Module = AccountManager.addFacebookAccount(facebookConfig) // [3] self.login.logInWithReadPermissions([/*"publish_actions", */"public_profile"], fromViewController: viewcontroller, handler: {
(result, error) -> Void in
http.authzModule = oauth2Module // [4]
//dispatch_async(dispatch_main(), <#T##block: dispatch_block_t##dispatch_block_t##() -> Void#>)
http.request(.GET, path: "/get", completionHandler: {
(response, error) in // [5]
// handle response
//print(response)
/*if((error != nil)){
//once everything is authorized save true value to the authorization boolean
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "fbAuthorized")
self.isAuthorized = NSUserDefaults.standardUserDefaults().boolForKey("fbAuthorized")
}*/
})
// self.isAuthorized = oauth2Module.isAuthorized()
/*
oauth2Module.revokeAccess({(response, error) in
if (error != nil) { if (error != nil) {
// do something with error NSLog("Process error")
print("accessrevoked") boolResult = false
} }
// do domething else if result.isCancelled {
}) NSLog("Cancelled")
*/ boolResult = false
}
else {
NSLog("Logged in with read permissions")
print(result.token)
print(result.grantedPermissions)
NSUserDefaults.standardUserDefaults().setBool(true, forKey:"fbAuthorized")
FBSDKAccessToken.setCurrentAccessToken(result.token)
print("user logged in through facebook")
self.makeGETRequest("",params: nil)
} }
if(!FBSDKAccessToken.currentAccessToken().hasGranted("publish_actions")){
dispatch_async(dispatch_get_main_queue(), { () -> Void in
func deAuthorizeApp(viewcontroller: UIViewController){ self.login.logInWithPublishPermissions(["publish_actions"], fromViewController: nil,handler: {
let facebookConfig = FacebookConfig( // [2] (result, error) -> Void in
clientId: self.apiKey,
clientSecret: self.apiSecret, NSLog("Logged in with publish permisions")
scopes:["publish_actions"])
let oauth2Module = AccountManager.addFacebookAccount(facebookConfig) // [3]
oauth2Module.revokeAccess({(response, error) in
if (error != nil) {
// do something with error
}
// do domething
}) })
})
}
})
})
return boolResult
}
print("token not valid")
return false
}
else{
print(FBSDKAccessToken.currentAccessToken())
print("user already logged in")
self.makeGETRequest("",params: nil)
return true
}
}
func deAuthorizeApp(viewcontroller: UIViewController) -> Bool{
return self.makeDELETIONResquest("/permissions", params: nil)
} }
} }
//MARK: - request methods(GET, POST, DELETE)
extension FacebookGraphAPIManager {
//when making request make sure path starts with '/'
func makeGETRequest(requestPath: String!, params: [NSObject: AnyObject]!) -> Bool{
let graphRequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me" + requestPath, parameters: params)
var boolResult: Bool = false
graphRequest.startWithCompletionHandler({
(id, result, error) -> Void in
print(result)
})
return boolResult
}
//used to post to users timeline, path must start with '/'
func makePOSTResquest(requestPath: String!, params: [NSObject: AnyObject]!){
let graphRequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me" + requestPath, parameters: params, HTTPMethod: "POST")
graphRequest.startWithCompletionHandler({
(id, result, error) -> Void in
print(result)
})
}
//used to delete permissions and listings from users timeline, path must start with '/'
func makeDELETIONResquest(requestPath: String!, params: [NSObject: AnyObject]!) -> Bool{
let graphRequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me" + requestPath, parameters: params, HTTPMethod: "DELETE")
var boolResult: Bool = false
dispatch_async(dispatch_get_main_queue(), {
graphRequest.startWithCompletionHandler({
(id, result, error) -> Void in
print(result)
if(requestPath == "/permssions"){
if(error == nil){
//this part is not getting called but almost have the oauth done
boolResult = true
NSUserDefaults.standardUserDefaults().setBool(false, forKey:"fbAuthorized")
}
else{
print(error.localizedDescription)
boolResult = false
}
}
boolResult = false
})
})
return boolResult
}
}

View File

@ -24,7 +24,7 @@
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>CFBundleURLName</key> <key>CFBundleURLName</key>
<string></string> <string>com.Kroleo.Vendoo</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>fb504150909777657</string> <string>fb504150909777657</string>
@ -39,8 +39,9 @@
<string>Vendoo</string> <string>Vendoo</string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>fbapi</string>
<string>fbauth2</string> <string>fbauth2</string>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbshareextension</string> <string>fbshareextension</string>
</array> </array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>

View File

@ -143,8 +143,13 @@ extension NetworksTableViewController: UITableViewDataSource {
cell = (self.tableView.dequeueReusableCellWithIdentifier("etsy", forIndexPath: indexPath) as! EtsyTableViewCell) cell = (self.tableView.dequeueReusableCellWithIdentifier("etsy", forIndexPath: indexPath) as! EtsyTableViewCell)
break break
default: default:
//loads network cell for ebay //loads network cell for facebook
cell = (self.tableView.dequeueReusableCellWithIdentifier("facebook", forIndexPath: indexPath) as! FBTableViewCell) cell = (self.tableView.dequeueReusableCellWithIdentifier("facebook", forIndexPath: indexPath) as! FBTableViewCell)
if((self.tabBarController as? HomeViewController)?.fbGraphManager.isAuthorized)!{
(cell as! FBTableViewCell).networkToggle.setOn(true, animated: false)
}
break break
} }
} }
@ -415,15 +420,17 @@ extension NetworksTableViewController: UITableViewDelegate {
cell = (self.tableView.dequeueReusableCellWithIdentifier("facebook", forIndexPath: indexPath) as! FBTableViewCell) cell = (self.tableView.dequeueReusableCellWithIdentifier("facebook", forIndexPath: indexPath) as! FBTableViewCell)
cell.setSelected(false, animated: false) cell.setSelected(false, animated: false)
//OAuthorization code for facebook //OAuthorization code for facebook
if(cell.networkToggle.on == true){ if((self.tabBarController as? HomeViewController)?.fbGraphManager.isAuthorized)!{
dispatch_async(dispatch_get_main_queue(), { () -> Void in dispatch_async(dispatch_get_main_queue(), { () -> Void in
cell.networkToggle.setOn(false, animated: true) cell.networkToggle.setOn(false, animated: true)
}) })
//code to deauthorize network //code to deauthorize network
let tabBar = self.tabBarController
let didSucceed:Bool = ((tabBar as? HomeViewController)?.fbGraphManager.deAuthorizeApp(self))!
cell.networkToggle.on = !didSucceed
} }
else{ else{
@ -435,10 +442,11 @@ extension NetworksTableViewController: UITableViewDelegate {
//this is the type of code desired to access the rest management classes //this is the type of code desired to access the rest management classes
let tabBar = self.tabBarController let tabBar = self.tabBarController
(tabBar as? HomeViewController)?.fbGraphManager.authorizeApp(self) let didSucceed: Bool = ((tabBar as? HomeViewController)?.fbGraphManager.authorizeApp(self))!
cell.networkToggle.on = didSucceed
//self.fbGraphManager.authorizeApp(self) //self.fbGraphManager.authorizeApp(self)
} }