diff --git a/.DS_Store b/.DS_Store
index 7f9adcc..fe5d633 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate
index 837e9df..1c64daa 100644
Binary files a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate and b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 28be050..943c478 100644
--- a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -67,5 +67,133 @@
landmarkType = "5">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Vendoo/EtsyRESTAPIManager.swift b/Vendoo/EtsyRESTAPIManager.swift
index e38cbb1..c665515 100644
--- a/Vendoo/EtsyRESTAPIManager.swift
+++ b/Vendoo/EtsyRESTAPIManager.swift
@@ -48,23 +48,24 @@ class EtsyRESTAPIManager: NSObject {
//Mark: - OAuth Methods
extension EtsyRESTAPIManager {
- //makes application ready for use with users ebay account
+ //makes application ready for use with users etsy account
func authorizeApp(viewcontroller: UIViewController){
- /*
+
let oauthswift = OAuth1Swift(parameters: ["consumerKey":"snbs78qkfy3yqq6yhe6yv49b","consumerSecret":"4sbva4oqb6", "requestTokenUrl" : "https://openapi.etsy.com/v2/oauth/request_token?scope=listings_w%20listings_r%20listings_d%20transactions_r%20transactions_w",
- "authorizeUrl": "",
- "accessTokenUrl": ""])
+ "authorizeUrl": "https://www.etsy.com/oauth/signin?",
+ "accessTokenUrl": "https://openapi.etsy.com/v2/oauth/access_token?"])
- //oauthswift.authorize_url_handler = SafariURLHandler(viewController: viewcontroller)
+ oauthswift!.authorize_url_handler = SafariURLHandler(viewController: viewcontroller)
oauthswift!.client.get("https://openapi.etsy.com/v2/oauth/request_token?scope=listings_w%20listings_r%20listings_d%20transactions_r%20transactions_w",
success: {
data, response in
let dataString = NSString(data: data, encoding: NSUTF8StringEncoding)
print(dataString!)
+ print(response)
@@ -78,14 +79,16 @@ extension EtsyRESTAPIManager {
}
)
- oauthswift!.authorizeWithCallbackURL( NSURL(string: "oauth-swift://oauth-callback/etsy")!, success: {
+ oauthswift!.authorizeWithCallbackURL( NSURL(string: "vendoo://oauth-callback/etsy")!, success: {
credential, response, parameters in
-
+ print(credential.oauth_token)
+ print(credential.oauth_token_secret)
+ print(response)
}, failure: { error in
- print(error.localizedDescription)
+ print(error)
})
- */
+
//once everything is authorized save true value to the authorization boolean
/*
diff --git a/Vendoo/Info.plist b/Vendoo/Info.plist
index 1fee3a0..f094d7c 100644
--- a/Vendoo/Info.plist
+++ b/Vendoo/Info.plist
@@ -30,6 +30,16 @@
fb504150909777657
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLName
+ com.Kroleo.Vendoo
+ CFBundleURLSchemes
+
+ vendoo
+
+
CFBundleVersion
1
diff --git a/Vendoo/ListingPreviewViewController.swift b/Vendoo/ListingPreviewViewController.swift
index da11ecd..8effecf 100644
--- a/Vendoo/ListingPreviewViewController.swift
+++ b/Vendoo/ListingPreviewViewController.swift
@@ -92,10 +92,17 @@ extension ListingPreviewViewController {
@IBAction func publishItem(sender: AnyObject) {
//publish items to facebook if it is selected
- let str = "**"+self.itemTitle.text!+"**"+"\n\n"+"Sellng for: "+self.itemPrice.text!+"\n\n"+self.itemDescription.text!
- let parameters = ["message":str]
+ if(self.networksDictionary["facebook"] == true){
+
+ let str = "**"+self.itemTitle.text!+"**"+"\n\n"+"Sellng for: "+self.itemPrice.text!+"\n\n"+self.itemDescription.text!
+ let parameters = ["message":str]
+
+ self.graphManager.makePOSTResquest("me/feed", params: parameters)
+
+ }else if(self.networksDictionary["etsy"] == true){
+
+ }
- self.graphManager.makePOSTResquest("me/feed", params: parameters)
}