From 5df12695df357c75e665a841acf9eab3e6b0cfc9 Mon Sep 17 00:00:00 2001 From: Okechi Onyeje Date: Wed, 5 Oct 2016 08:53:06 -0400 Subject: [PATCH] Ebay Ended and Sold notifications completed. Sold, Unsold, and Selling completed --- .../UserInterfaceState.xcuserstate | Bin 22962 -> 25217 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 629 +----------------- Vendoo/EbayWebServiceManager.swift | 4 +- Vendoo/HomeViewController.swift | 77 ++- Vendoo/ItemTableViewController.swift | 164 +++-- Vendoo/Main.storyboard | 12 +- Vendoo/ServiceNotificationManager.swift | 40 +- 7 files changed, 233 insertions(+), 693 deletions(-) diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate index 6a7ce46937bab1c4be83afbdd046892e3161e845..dc2f0c7659d6d6b55b6eee3deec3e3e2dc2331f8 100644 GIT binary patch delta 13847 zcma)C2V7HExWDJz#RxJK83{?)Q4)ke2s01@AtV73u@0&tLPV6I47cVUYhBe^jaIGI z%5ZC~TI;U0t}1oltaVgdweDHlT5WwNK~P)Y`#nc;@44rG_nZH3B^J7y~AQDM4T=mcwmcxTf+r9_ z2uVmm59kTKpb(0n7zV;17z{&TD2#@37z0yb8dSq{m<#iu37TO)*dG?cp|BiQz|n9F z919VAA5MmIpbgH2^Wewu6SxT0!v@$0H^7Z>6Z{fxhF`%ga4XyfkHZ#t0-l7Yp!GC7 z1JA-A;5qmsJP$9xi|`Ws30{U*;Lq?Ecop7&_uwP=n50RDWJxE|nRFptNgnA=b|gEK zJ|v$EB!kFMGMto`v)Duq%}sgyO1Qd8-ahRUEaseV*{s*oB$6;T7JVyc9)P=lyaYA7|F zs-{L!qpA0(N!0t)WNJF~DYckdLVZRprRu2$s*!4vmyF6wJ)Kh;cqPaUCJ zsMFLL>MV7hxPV)JztW%XDXYG6hV3rjRLS1~cW%Fs7Cn!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zwJCKeZ>GGHGBf4f zl({MMQWm5vPFa@HoYI=IGG%MZ$&@Q8w^CuMcWPv6O6s80(W#SDQR-`{(;TU9r%q2@ zp1LOWqts7QH>7S#{W5ib>Y>ylsV7sk(FW0FlThj=#f#J(L1AWM*obV8MPU&XS|=WDr0NL znT+!pmomQ1xR&ul#_fzd8Fw@O&SWzMnI4&5nE{zyGZQl{ncXudWI8g}W$w@X(UIky z6__Q?3eF16(q>t*24pp6y_>~n&C6PlwK!{I*3PWGS;w<}&w7##vYBi_wnuhYc0_iU zY(;i#wlX_8yL)!e>|WV@v-@Wc&9-Nc$R3$ppS?7@CHrvpne0bK${1x-8}-IiV}{XW zv>2_%d}DtjHcm70#s$X3#$`rFt8tZat?>inCgYdJgT}+gW5$!l3&zXFtH$q*KbnLl zg(=HqH5Hh;n~F?>P1UB+rh3y@QOZk8UFo|aNejb)6b!7|P= z!7|x`EU#JSTIN|C3oMH*%Ph^7Hp^<@L%d%PY?t=E$qe8=KdZHz{vQ-d(Gg zRcw`7L##4uj5W@hU{zVI);`u!>rkuRI>I{2+F%`LonW18Mb@d->DE^3$JQ;@eb%Ga z6V}t#bJmO2AFS7{H>|g;cdU19-nLj%! zv3+3s*fwB;?Q`2!+jiSt+Y#GE+g025w(GW=wmY`pZ1-)C^VxjA{DAzRd})4YzARsp hpPg^aH|6K#_st)eKh(7cr66qo6^Pn@JHGQP{vY()$|?W= diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 520eda7..c78dbce 100644 --- a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -9,640 +9,29 @@ shouldBeEnabled = "Yes" ignoreCount = "0" continueAfterRunningActions = "No" -<<<<<<< HEAD filePath = "Vendoo/HomeViewController.swift" - timestampString = "494906385.49118" + timestampString = "497362780.635053" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "183" - endingLineNumber = "183"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >>>>>> Rapid-Dev-Branch - startingColumnNumber = "9223372036854775807" - endingColumnNumber = "9223372036854775807" - startingLineNumber = "865" - endingLineNumber = "865" - landmarkName = "toggleNetworkSelection(_:)" - landmarkType = "5"> - - - - - - - - - - - - - - - - - - - - - - - - -<<<<<<< HEAD - - - - - - -======= ->>>>>>> Rapid-Dev-Branch - - - - - - - - - - -======= - urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SignInViewController.swift" - timestampString = "496597493.364189" - startingColumnNumber = "9223372036854775807" - endingColumnNumber = "9223372036854775807" - startingLineNumber = "57" - endingLineNumber = "57" - offsetFromSymbolStart = "19"> ->>>>>>> Rapid-Dev-Branch - - -======= - urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/SignInViewController.swift" - timestampString = "496597493.364295" - startingColumnNumber = "9223372036854775807" - endingColumnNumber = "9223372036854775807" - startingLineNumber = "58" - endingLineNumber = "58" - offsetFromSymbolStart = "37"> ->>>>>>> Rapid-Dev-Branch - - - - - - - - - - - - - - - - - - >>>>>> Rapid-Dev-Branch + startingLineNumber = "238" + endingLineNumber = "238" + landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)" landmarkType = "5"> diff --git a/Vendoo/EbayWebServiceManager.swift b/Vendoo/EbayWebServiceManager.swift index 31e9faa..1458763 100644 --- a/Vendoo/EbayWebServiceManager.swift +++ b/Vendoo/EbayWebServiceManager.swift @@ -542,14 +542,14 @@ extension EbayWebServiceManager: NSXMLParserDelegate { } else { - if "\(self.catDetailLevel)" == self.catLevel { + /*if "\(self.catDetailLevel)" == self.catLevel { if((self.subCategories[string] == nil )){ self.subCategories[string] = ["cat_id": self.catID, "isLeaf": false, "level": self.catLevel] } } - self.currentCategory = string + self.currentCategory = string*/ } diff --git a/Vendoo/HomeViewController.swift b/Vendoo/HomeViewController.swift index df1063e..8a1ee65 100644 --- a/Vendoo/HomeViewController.swift +++ b/Vendoo/HomeViewController.swift @@ -16,6 +16,8 @@ class HomeViewController: UITabBarController { let firebaseManager = FirebaseManager() let ebayGraphManager = EbayWebServiceManager() var userListings: [Listing] = [] + var endedListings: [Listing] = [] + var soldListings: [Listing] = [] var notificationsManager = ServiceNotificationManager() var notifications: [Dictionary] = (NSUserDefaults.standardUserDefaults().objectForKey("notifications") == nil ? [] : (NSUserDefaults.standardUserDefaults().objectForKey("notifications") as! [Dictionary])) @@ -91,17 +93,47 @@ class HomeViewController: UITabBarController { dispatch_group_notify(serviceGroup, dispatch_get_main_queue(), { print(listingImages.count) let listingInfo = values as? [String : AnyObject] - self.userListings.append( - Listing(itemTitle: (listingInfo!["listingTitle"] as? String)!, - itemCategory: listingInfo!["listingCategory"] as? String, - itemQuantity: (listingInfo!["listingQuantity"] as? String)!, - itemPrice: listingInfo!["listingPrice"] as? String, - itemDescription: listingInfo!["listingDescription"] as? String, - itemImages: listingImages, - isDraftListing: (listingInfo!["isListingDraft"] as? Bool)!, - itemKey: key, - networksSellingOn: (listingInfo!["networks"] as? Dictionary)! + + if listingInfo!["listingStatus"] == nil { + self.userListings.append( + Listing(itemTitle: (listingInfo!["listingTitle"] as? String)!, + itemCategory: listingInfo!["listingCategory"] as? String, + itemQuantity: (listingInfo!["listingQuantity"] as? String)!, + itemPrice: listingInfo!["listingPrice"] as? String, + itemDescription: listingInfo!["listingDescription"] as? String, + itemImages: listingImages, + isDraftListing: (listingInfo!["isListingDraft"] as? Bool)!, + itemKey: key, + networksSellingOn: (listingInfo!["networks"] as? Dictionary)! )) + } + else if listingInfo!["listingStatus"] as? String == "Ended" { + self.endedListings.append( + Listing(itemTitle: (listingInfo!["listingTitle"] as? String)!, + itemCategory: listingInfo!["listingCategory"] as? String, + itemQuantity: (listingInfo!["listingQuantity"] as? String)!, + itemPrice: listingInfo!["listingPrice"] as? String, + itemDescription: listingInfo!["listingDescription"] as? String, + itemImages: listingImages, + isDraftListing: (listingInfo!["isListingDraft"] as? Bool)!, + itemKey: key, + networksSellingOn: (listingInfo!["networks"] as? Dictionary)! + )) + } + else if listingInfo!["listingStatus"] as? String == "Sold" { + self.soldListings.append( + Listing(itemTitle: (listingInfo!["listingTitle"] as? String)!, + itemCategory: listingInfo!["listingCategory"] as? String, + itemQuantity: (listingInfo!["listingQuantity"] as? String)!, + itemPrice: listingInfo!["listingPrice"] as? String, + itemDescription: listingInfo!["listingDescription"] as? String, + itemImages: listingImages, + isDraftListing: (listingInfo!["isListingDraft"] as? Bool)!, + itemKey: key, + networksSellingOn: (listingInfo!["networks"] as? Dictionary)! + )) + } + print(notificationStartTracker) if(notificationStartTracker == listingDict?.count){ NSNotificationCenter.defaultCenter().postNotificationName("finished_fetching_listings", object: nil) @@ -189,11 +221,24 @@ extension HomeViewController: ServiceNotificationManagerDelegate { [ "network": "ebay", "message": (ebayInfo as! [String : AnyObject])["notification"] as! String, - "type": "ended", + "type": (ebayInfo as! [String : AnyObject])["type"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "UUID": NSUUID().UUIDString ] ) + self.endedListings.appendContentsOf( self.userListings.filter({$0.key == ((ebayInfo as! [String : AnyObject])["listingKey"] as! String)})) + self.userListings = self.userListings.filter({$0.key != ((ebayInfo as! [String : AnyObject])["listingKey"] as! String)}) + let itemsView = self.viewControllers![0] as! ItemTableViewController + + self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)/user_Listings/\(((ebayInfo as! [String : AnyObject])["listingKey"] as! String))").observeSingleEventOfType( .Value, withBlock: { + (snapshot) -> Void in + + var listingDict = snapshot.value as? [String : AnyObject] + listingDict!["listingStatus"] = "Ended" + self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)/user_Listings/\(((ebayInfo as! [String : AnyObject])["listingKey"] as! String))").setValue(listingDict) + + itemsView.itemTable.reloadData() + }) } if (amazonInfo != nil) { @@ -201,7 +246,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate { [ "network": "amazon", "message": (ebayInfo as! [String : AnyObject])["notification"] as! String, - "type": "ended", + "type": (ebayInfo as! [String : AnyObject])["type"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "UUID": NSUUID().UUIDString ] @@ -230,7 +275,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate { [ "network": "facebook", "message": (ebayInfo as! [String : AnyObject])["notification"] as! String, - "type": "ended", + "type": (ebayInfo as! [String : AnyObject])["type"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "UUID": NSUUID().UUIDString ] @@ -242,7 +287,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate { [ "network": "ebay", "message": (ebayInfo as! [String : AnyObject])["notification"] as! String, - "type": "ended", + "type": (ebayInfo as! [String : AnyObject])["type"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "UUID": NSUUID().UUIDString ] @@ -254,7 +299,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate { [ "network": "amazon", "message": (ebayInfo as! [String : AnyObject])["notification"] as! String, - "type": "ended", + "type": "", "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "UUID": NSUUID().UUIDString ] @@ -266,7 +311,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate { [ "network": "etsy", "message": (ebayInfo as! [String : AnyObject])["notification"] as! String, - "type": "ended", + "type": "", "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "UUID": NSUUID().UUIDString ] diff --git a/Vendoo/ItemTableViewController.swift b/Vendoo/ItemTableViewController.swift index 2da8be4..ff66e52 100644 --- a/Vendoo/ItemTableViewController.swift +++ b/Vendoo/ItemTableViewController.swift @@ -80,6 +80,12 @@ class ItemTableViewController: UIViewController { } +// MARK: - IBAction +extension ItemTableViewController { + @IBAction func segSwitch(sender: UISegmentedControl) { + self.itemTable.reloadData() + } +} // MARK: - Navigation extension ItemTableViewController { @@ -129,63 +135,143 @@ extension ItemTableViewController: UITableViewDataSource{ func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows - return ((self.tabBarController as? HomeViewController)?.userListings.count)! + if self.tableSegmentController.selectedSegmentIndex == 0 { + return ((self.tabBarController as? HomeViewController)?.userListings.count)! + } + else if tableSegmentController.selectedSegmentIndex == 1 { + return ((self.tabBarController as? HomeViewController)?.endedListings.count)! + } + else{ + return ((self.tabBarController as? HomeViewController)?.soldListings.count)! + } + + } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell: ItemCell! = (tableView.dequeueReusableCellWithIdentifier("Item Cell", forIndexPath: indexPath) as! ItemCell) - - - // Configure the cell... //for each listing cell generated need to find the marketplaces it belongs to, the listing price, the name of the item, the status of the item, and the item image. //Once these objects are retrieved, access the ItemCell properties and manipulate as needed - cell.itemImage.image = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row].images[0] //come back - cell.itemName.text = (self.tabBarController as? HomeViewController)!.userListings[indexPath.row].title - cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.userListings[indexPath.row].price - //check if item is published - if((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].isDraft!){ - cell.itemStatus.text = "Status: Unpublished" - dispatch_async(dispatch_get_main_queue(), { - - cell.alpha = 0.5 - - - }) + if self.tableSegmentController.selectedSegmentIndex == 0 { + cell.itemImage.image = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row].images[0] //come back + cell.itemName.text = (self.tabBarController as? HomeViewController)!.userListings[indexPath.row].title + cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.userListings[indexPath.row].price - }else { - cell.itemStatus.text = "Status: Active" - } - - if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["areNetworksChosen"])!){ - cell.networks.hidden = true - }else{ - dispatch_async(dispatch_get_main_queue(), { - if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["ebay"])!){ - cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true - } - if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["amazon"])!){ - cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true - } - if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["etsy"])!){ - cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true + //check if item is published + if((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].isDraft!){ + cell.itemStatus.text = "Status: Unpublished" + dispatch_async(dispatch_get_main_queue(), { - } - if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["facebook"])!){ - cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true - } - - }) + cell.alpha = 0.5 + + + }) + + }else { + cell.itemStatus.text = "Status: Active" + } + if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["areNetworksChosen"])!){ + cell.networks.hidden = true + }else{ + dispatch_async(dispatch_get_main_queue(), { + if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["ebay"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true + } + if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["amazon"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true + } + if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["etsy"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true + + } + if(!((self.tabBarController as? HomeViewController)!.userListings[indexPath.row].networks["facebook"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true + } + + }) + + } + } + else if tableSegmentController.selectedSegmentIndex == 1 { + cell.itemImage.image = (self.tabBarController as? HomeViewController)?.endedListings[indexPath.row].images[0] //come back + cell.itemName.text = (self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].title + cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].price + + cell.itemStatus.text = "Status: Unsold" + + if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["areNetworksChosen"])!){ + cell.networks.hidden = true + }else{ + dispatch_async(dispatch_get_main_queue(), { + if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["ebay"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true + } + if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["amazon"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true + } + if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["etsy"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true + + } + if(!((self.tabBarController as? HomeViewController)!.endedListings[indexPath.row].networks["facebook"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true + } + + }) + + } + + } + else{ + cell.itemImage.image = (self.tabBarController as? HomeViewController)?.soldListings[indexPath.row].images[0] //come back + cell.itemName.text = (self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].title + cell.itemPrice.text = (self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].price + + cell.itemStatus.text = "Status: Sold" + + if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["areNetworksChosen"])!){ + cell.networks.hidden = true + }else{ + dispatch_async(dispatch_get_main_queue(), { + if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["ebay"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))?.hidden = true + } + if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["amazon"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 1, inSection: 0))?.hidden = true + } + if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["etsy"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 2, inSection: 0))?.hidden = true + + } + if(!((self.tabBarController as? HomeViewController)!.soldListings[indexPath.row].networks["facebook"])!){ + cell.networks.cellForItemAtIndexPath(NSIndexPath(forRow: 3, inSection: 0))?.hidden = true + } + + }) + + } + } + + return cell } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { - self.selectedListing = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row] + if self.tableSegmentController.selectedSegmentIndex == 0 { + self.selectedListing = (self.tabBarController as? HomeViewController)?.userListings[indexPath.row] + } + else if tableSegmentController.selectedSegmentIndex == 1 { + self.selectedListing = (self.tabBarController as? HomeViewController)?.endedListings[indexPath.row] + } + else{ + self.selectedListing = (self.tabBarController as? HomeViewController)?.soldListings[indexPath.row] + } self.performSegueWithIdentifier("ItemDetailSegue", sender: self) } } diff --git a/Vendoo/Main.storyboard b/Vendoo/Main.storyboard index cb927f7..a2f6b1f 100755 --- a/Vendoo/Main.storyboard +++ b/Vendoo/Main.storyboard @@ -1242,14 +1242,18 @@ - + + + + + @@ -2501,11 +2505,11 @@ + + - - - + diff --git a/Vendoo/ServiceNotificationManager.swift b/Vendoo/ServiceNotificationManager.swift index 9afef9f..cac2c7e 100644 --- a/Vendoo/ServiceNotificationManager.swift +++ b/Vendoo/ServiceNotificationManager.swift @@ -33,7 +33,8 @@ class ServiceNotificationManager: NSObject { } func startServicePolling() { - timer = NSTimer.scheduledTimerWithTimeInterval(10.0, target: self, selector: #selector(ServiceNotificationManager.pollServices), userInfo: nil, repeats: true) + //timer = NSTimer.scheduledTimerWithTimeInterval(60.0, target: self, selector: #selector(ServiceNotificationManager.pollServices), userInfo: nil, repeats: true) + pollServices() } func stopServicePolling() { @@ -76,18 +77,33 @@ class ServiceNotificationManager: NSObject { (listingNotificationInfo, error) -> Void in //dispatch_group_leave(notificationGroup) let info = (listingNotificationInfo as! [String : AnyObject]) - if((info["quantitySold"] as! Int) > 0) { - //@TODO: Add both firbase logic and code logic to do notifications for sold listings - } if(info["status"] as! String == "Ended") { - ServiceNotificationManager.delegate?.listingHasEnded( - nil, - ebayInfo: [ - "notification": "Your listing \"\(listingDict!["listingTitle"] as! String)\" has ended on ebay.", - "listingKey": listing.key], - amazonInfo: nil, - etsyInfo: nil - ) + if((info["quantitySold"] as! Int) > 0) { + //@TODO: Add both firbase logic and code logic to do notifications for sold listings + if (((info["itemQuantity"] as! Int) - (info["quantitySold"] as! Int)) == 0) { + + ServiceNotificationManager.delegate?.listingHasNewNotifications( + nil, + ebayInfo: [ + "type": "Sold", + "notification": "Your listing \"\(listingDict!["listingTitle"] as! String)\" has sold out on ebay.", + "listingKey": listing.key], + amazonInfo: nil, + etsyInfo: nil + ) + } + }else{ + ServiceNotificationManager.delegate?.listingHasEnded( + nil, + ebayInfo: [ + "type": "Ended", + "notification": "Your listing \"\(listingDict!["listingTitle"] as! String)\" has ended on ebay.", + "listingKey": listing.key], + amazonInfo: nil, + etsyInfo: nil + ) + } + }