Reimplemented notifications for facebook

This commit is contained in:
Okechi Onyeje 2016-11-10 09:15:43 -05:00
parent bf987b6418
commit 9861802bb5
11 changed files with 924 additions and 73 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -41,6 +41,8 @@
3EC3252F1CF894E500626C48 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EC3252E1CF894E500626C48 /* AVFoundation.framework */; }; 3EC3252F1CF894E500626C48 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EC3252E1CF894E500626C48 /* AVFoundation.framework */; };
3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECEDB861CF9C722003566B3 /* ListingPreviewViewController.swift */; }; 3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECEDB861CF9C722003566B3 /* ListingPreviewViewController.swift */; };
3EDE75AE1D67B92F00BC3472 /* CategoryPopUpController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDE75AD1D67B92F00BC3472 /* CategoryPopUpController.swift */; }; 3EDE75AE1D67B92F00BC3472 /* CategoryPopUpController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EDE75AD1D67B92F00BC3472 /* CategoryPopUpController.swift */; };
3EE734E61DCD34AE00F771AE /* NotificationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE734E51DCD34AE00F771AE /* NotificationsViewController.swift */; };
3EE734E81DCD34B900F771AE /* NotificationTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE734E71DCD34B900F771AE /* NotificationTableViewCell.swift */; };
3EF422B21D73262000B9A3EB /* UserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF422B11D73262000B9A3EB /* UserCell.swift */; }; 3EF422B21D73262000B9A3EB /* UserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF422B11D73262000B9A3EB /* UserCell.swift */; };
3EFB0E331D0B968300A05D7A /* SideMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFB0E321D0B968300A05D7A /* SideMenuView.swift */; }; 3EFB0E331D0B968300A05D7A /* SideMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFB0E321D0B968300A05D7A /* SideMenuView.swift */; };
3F8E0464700649BDD8B552B1 /* Pods_Vendoo_VendooTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B876489113F498AF1D2FD7E9 /* Pods_Vendoo_VendooTests.framework */; }; 3F8E0464700649BDD8B552B1 /* Pods_Vendoo_VendooTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B876489113F498AF1D2FD7E9 /* Pods_Vendoo_VendooTests.framework */; };
@ -108,6 +110,8 @@
3EC3252E1CF894E500626C48 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 3EC3252E1CF894E500626C48 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
3ECEDB861CF9C722003566B3 /* ListingPreviewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListingPreviewViewController.swift; sourceTree = "<group>"; }; 3ECEDB861CF9C722003566B3 /* ListingPreviewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListingPreviewViewController.swift; sourceTree = "<group>"; };
3EDE75AD1D67B92F00BC3472 /* CategoryPopUpController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CategoryPopUpController.swift; sourceTree = "<group>"; }; 3EDE75AD1D67B92F00BC3472 /* CategoryPopUpController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CategoryPopUpController.swift; sourceTree = "<group>"; };
3EE734E51DCD34AE00F771AE /* NotificationsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationsViewController.swift; sourceTree = "<group>"; };
3EE734E71DCD34B900F771AE /* NotificationTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationTableViewCell.swift; sourceTree = "<group>"; };
3EF422B11D73262000B9A3EB /* UserCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserCell.swift; sourceTree = "<group>"; }; 3EF422B11D73262000B9A3EB /* UserCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserCell.swift; sourceTree = "<group>"; };
3EFB0E321D0B968300A05D7A /* SideMenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuView.swift; sourceTree = "<group>"; }; 3EFB0E321D0B968300A05D7A /* SideMenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuView.swift; sourceTree = "<group>"; };
7D1FC6F6278B48A7BA9A9E03 /* Pods_Vendoo_VendooUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Vendoo_VendooUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7D1FC6F6278B48A7BA9A9E03 /* Pods_Vendoo_VendooUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Vendoo_VendooUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@ -173,11 +177,11 @@
3E4897CE1D0062860069F742 /* Services */ = { 3E4897CE1D0062860069F742 /* Services */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3E3A00491D76680E00A3A5B6 /* ServiceNotificationManager.swift */,
3EA668941D026E2A00EE57A8 /* EbayServices */, 3EA668941D026E2A00EE57A8 /* EbayServices */,
3E4897CF1D00629B0069F742 /* FirebaseServices */, 3E4897CF1D00629B0069F742 /* FirebaseServices */,
3E7CF3FF1CF6363200F486B2 /* EtsyServices */, 3E7CF3FF1CF6363200F486B2 /* EtsyServices */,
3EC325241CF7E6B300626C48 /* FacebookServices */, 3EC325241CF7E6B300626C48 /* FacebookServices */,
3E3A00491D76680E00A3A5B6 /* ServiceNotificationManager.swift */,
); );
name = Services; name = Services;
sourceTree = "<group>"; sourceTree = "<group>";
@ -327,9 +331,19 @@
name = NewItemPostingSession; name = NewItemPostingSession;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
3EE734E41DCD347900F771AE /* Notifications */ = {
isa = PBXGroup;
children = (
3EE734E71DCD34B900F771AE /* NotificationTableViewCell.swift */,
3EE734E51DCD34AE00F771AE /* NotificationsViewController.swift */,
);
name = Notifications;
sourceTree = "<group>";
};
3EFB0E2F1D0B95B200A05D7A /* Menu */ = { 3EFB0E2F1D0B95B200A05D7A /* Menu */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
3EE734E41DCD347900F771AE /* Notifications */,
3E1AA4331D0DD0B2005FCCBB /* Settings */, 3E1AA4331D0DD0B2005FCCBB /* Settings */,
3EFB0E321D0B968300A05D7A /* SideMenuView.swift */, 3EFB0E321D0B968300A05D7A /* SideMenuView.swift */,
3E1AA4311D0DA071005FCCBB /* MenuPanelViewController.swift */, 3E1AA4311D0DA071005FCCBB /* MenuPanelViewController.swift */,
@ -744,6 +758,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
3EE734E81DCD34B900F771AE /* NotificationTableViewCell.swift in Sources */,
3E6CC35B1CF2A94B00E00A70 /* SignUpViewController.swift in Sources */, 3E6CC35B1CF2A94B00E00A70 /* SignUpViewController.swift in Sources */,
3E1AA4321D0DA071005FCCBB /* MenuPanelViewController.swift in Sources */, 3E1AA4321D0DA071005FCCBB /* MenuPanelViewController.swift in Sources */,
3E4897D11D0067030069F742 /* FirebaseManager.swift in Sources */, 3E4897D11D0067030069F742 /* FirebaseManager.swift in Sources */,
@ -762,6 +777,7 @@
3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */, 3ECEDB871CF9C722003566B3 /* ListingPreviewViewController.swift in Sources */,
3E1B1F0B1D2493EE00DBCF08 /* EtsySettingsViewController.swift in Sources */, 3E1B1F0B1D2493EE00DBCF08 /* EtsySettingsViewController.swift in Sources */,
3EC325231CF7DA5500626C48 /* HomeViewController.swift in Sources */, 3EC325231CF7DA5500626C48 /* HomeViewController.swift in Sources */,
3EE734E61DCD34AE00F771AE /* NotificationsViewController.swift in Sources */,
3EC3252D1CF894C400626C48 /* ItemImagePickerViewController.swift in Sources */, 3EC3252D1CF894C400626C48 /* ItemImagePickerViewController.swift in Sources */,
3E1DC3CD1D4232490091BC60 /* CategoriesTableViewController.swift in Sources */, 3E1DC3CD1D4232490091BC60 /* CategoriesTableViewController.swift in Sources */,
3E7CF4011CF6366300F486B2 /* EtsyRESTAPIManager.swift in Sources */, 3E7CF4011CF6366300F486B2 /* EtsyRESTAPIManager.swift in Sources */,

View File

@ -10,11 +10,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift" filePath = "Vendoo/HomeViewController.swift"
timestampString = "497362780.635053" timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "232" startingLineNumber = "286"
endingLineNumber = "232" endingLineNumber = "286"
landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)" landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@ -26,11 +26,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift" filePath = "Vendoo/HomeViewController.swift"
timestampString = "497362780.635053" timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "238" startingLineNumber = "293"
endingLineNumber = "238" endingLineNumber = "293"
landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)" landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@ -90,11 +90,183 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/ServiceNotificationManager.swift" filePath = "Vendoo/ServiceNotificationManager.swift"
timestampString = "498402552.569625" timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "124" startingLineNumber = "236"
endingLineNumber = "124" endingLineNumber = "236">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500475450.307316"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "373"
endingLineNumber = "373"
landmarkName = "listingHasNewNotifications(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500475450.307316"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "375"
endingLineNumber = "375"
landmarkName = "listingHasNewNotifications(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500214475.708805"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "243"
endingLineNumber = "243"
landmarkName = "getListingInfo(_:onCompletion:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.getListingInfo (Swift.ImplicitlyUnwrappedOptional&lt;Swift.String&gt;, onCompletion : Swift.ImplicitlyUnwrappedOptional&lt;(Swift.Optional&lt;Swift.AnyObject&gt;, Swift.Optional&lt;__ObjC.NSError&gt;) -&gt; ()&gt;) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "499916772.054646"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "244"
endingLineNumber = "244"
offsetFromSymbolStart = "357">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(getListingInfo (Swift.ImplicitlyUnwrappedOptional&lt;Swift.String&gt;, onCompletion : Swift.ImplicitlyUnwrappedOptional&lt;(Swift.Optional&lt;Swift.AnyObject&gt;, Swift.Optional&lt;__ObjC.NSError&gt;) -&gt; ()&gt;) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "499916772.054749"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "245"
endingLineNumber = "245"
offsetFromSymbolStart = "23">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500215169.912319"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "252"
endingLineNumber = "252"
landmarkName = "getListingInfo(_:onCompletion:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500215169.912319"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "255"
endingLineNumber = "255"
landmarkName = "FacebookGraphAPIManager"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500215169.912319"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "257"
endingLineNumber = "257">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ServiceNotificationManager.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "164"
endingLineNumber = "164"
landmarkName = "pollServices()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ServiceNotificationManager.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "170"
endingLineNumber = "170"
landmarkName = "pollServices()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ServiceNotificationManager.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "203"
endingLineNumber = "203"
landmarkName = "pollServices()" landmarkName = "pollServices()"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@ -106,12 +278,248 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift" filePath = "Vendoo/HomeViewController.swift"
timestampString = "499579562.452493" timestampString = "500475450.307316"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "256" startingLineNumber = "403"
endingLineNumber = "256" endingLineNumber = "403">
landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)" </BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500475450.307316"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "410"
endingLineNumber = "410">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ServiceNotificationManager.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "174"
endingLineNumber = "174"
landmarkName = "pollServices()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "153"
endingLineNumber = "153"
landmarkName = "viewDidLoad()"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.HomeViewController.(viewDidLoad () -&gt; ()).(closure #1).(closure #1).(closure #1).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "500214480.386596"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "146"
endingLineNumber = "146"
offsetFromSymbolStart = "2573">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.HomeViewController.(viewDidLoad () -&gt; ()).(closure #1).(closure #1).(closure #1).(closure #1).(closure #1).(closure #2)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "500214480.386715"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "146"
endingLineNumber = "146"
offsetFromSymbolStart = "22978">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "165"
endingLineNumber = "165"
landmarkName = "viewDidLoad()"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.HomeViewController.(viewDidLoad () -&gt; ()).(closure #1).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "500215171.289152"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "155"
endingLineNumber = "155"
offsetFromSymbolStart = "1675">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.HomeViewController.(viewDidLoad () -&gt; ()).(closure #1).(closure #1).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "500215171.289318"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "155"
endingLineNumber = "155"
offsetFromSymbolStart = "1537">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NotificationTableViewCell.swift"
timestampString = "499993520.858648"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "13"
endingLineNumber = "13"
landmarkName = "NotificationTableViewCell"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500214387.985452"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "245"
endingLineNumber = "245"
landmarkName = "getListingInfo(_:onCompletion:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500215169.912319"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "249"
endingLineNumber = "249"
landmarkName = "getListingInfo(_:onCompletion:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(getListingInfo (Swift.ImplicitlyUnwrappedOptional&lt;Swift.String&gt;, onCompletion : Swift.ImplicitlyUnwrappedOptional&lt;(Swift.Optional&lt;Swift.AnyObject&gt;, Swift.Optional&lt;__ObjC.NSError&gt;) -&gt; ()&gt;) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500214480.389538"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "249"
endingLineNumber = "249"
offsetFromSymbolStart = "233">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.FacebookGraphAPIManager.(getListingInfo (Swift.ImplicitlyUnwrappedOptional&lt;Swift.String&gt;, onCompletion : Swift.ImplicitlyUnwrappedOptional&lt;(Swift.Optional&lt;Swift.AnyObject&gt;, Swift.Optional&lt;__ObjC.NSError&gt;) -&gt; ()&gt;) -&gt; ()).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500214480.389655"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "249"
endingLineNumber = "249"
offsetFromSymbolStart = "254">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "152"
endingLineNumber = "152"
landmarkName = "viewDidLoad()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "150"
endingLineNumber = "150"
landmarkName = "viewDidLoad()"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
@ -122,12 +530,44 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift" filePath = "Vendoo/HomeViewController.swift"
timestampString = "499579731.915475" timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "273" startingLineNumber = "151"
endingLineNumber = "273" endingLineNumber = "151"
landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)" landmarkName = "viewDidLoad()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/FacebookGraphAPIManager.swift"
timestampString = "500215169.912319"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "247"
endingLineNumber = "247"
landmarkName = "getListingInfo(_:onCompletion:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/ServiceNotificationManager.swift"
timestampString = "500219461.305955"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "128"
endingLineNumber = "128"
landmarkName = "pollServices()"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
@ -138,12 +578,203 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift" filePath = "Vendoo/HomeViewController.swift"
timestampString = "499579805.922963" timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "275" startingLineNumber = "310"
endingLineNumber = "275" endingLineNumber = "310"
landmarkName = "listingHasEnded(_:ebayInfo:amazonInfo:etsyInfo:)" landmarkName = "listingHasNewNotifications(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "313"
endingLineNumber = "313"
landmarkName = "listingHasNewNotifications(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500473804.952967"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "322"
endingLineNumber = "322"
landmarkName = "listingHasNewNotifications(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500475450.307316"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "335"
endingLineNumber = "335"
landmarkName = "listingHasNewNotifications(_:ebayInfo:amazonInfo:etsyInfo:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500474943.700874"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "33"
endingLineNumber = "33"
landmarkName = "viewDidLoad()"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.HomeViewController.(viewDidLoad () -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "500479034.794063"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "33"
endingLineNumber = "33"
offsetFromSymbolStart = "19">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.HomeViewController.(viewDidLoad () -&gt; ()).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/HomeViewController.swift"
timestampString = "500479034.794166"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "36"
endingLineNumber = "36"
offsetFromSymbolStart = "48">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/HomeViewController.swift"
timestampString = "500474964.899818"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "36"
endingLineNumber = "36"
landmarkName = "viewDidLoad()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NotificationsViewController.swift"
timestampString = "500478897.162903"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NotificationsViewController.tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -&gt; ()"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NotificationsViewController.swift"
timestampString = "500479034.795518"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
offsetFromSymbolStart = "101">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NotificationsViewController.(tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -&gt; ()).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NotificationsViewController.swift"
timestampString = "500479034.795677"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
offsetFromSymbolStart = "19">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Vendoo.NotificationsViewController.(tableView (__ObjC.UITableView, didSelectRowAtIndexPath : __ObjC.NSIndexPath) -&gt; ()).(closure #1).(closure #1)"
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/NotificationsViewController.swift"
timestampString = "500479034.795815"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
offsetFromSymbolStart = "15">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/NotificationsViewController.swift"
timestampString = "500479690.07453"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "58"
endingLineNumber = "58"
landmarkName = "tableView(_:didSelectRowAtIndexPath:)"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>

BIN
Vendoo/.DS_Store vendored

Binary file not shown.

View File

@ -238,4 +238,18 @@ extension FacebookGraphAPIManager {
return boolResult return boolResult
} }
func getListingInfo(requestPath: String!, onCompletion: ServiceResponse!){
let graphRequest:FBSDKGraphRequest = FBSDKGraphRequest(graphPath: requestPath, parameters: nil, HTTPMethod: "GET")
dispatch_async(dispatch_get_main_queue(), {
graphRequest.startWithCompletionHandler({
(id, result, error) -> Void in
if error == nil {
onCompletion((result as! [String : AnyObject])["data"] as! [[String:AnyObject]],nil)
}
})
})
}
} }

View File

@ -19,7 +19,7 @@ class HomeViewController: UITabBarController {
var endedListings: [Listing] = [] var endedListings: [Listing] = []
var soldListings: [Listing] = [] var soldListings: [Listing] = []
var notificationsManager = ServiceNotificationManager() var notificationsManager = ServiceNotificationManager()
var notifications: [Dictionary<String, String>] = (NSUserDefaults.standardUserDefaults().objectForKey("notifications") == nil ? [] : (NSUserDefaults.standardUserDefaults().objectForKey("notifications") as! [Dictionary<String, String>])) var notifications: [Dictionary<String, AnyObject>] = (NSUserDefaults.standardUserDefaults().objectForKey("notifications") == nil ? [] : (NSUserDefaults.standardUserDefaults().objectForKey("notifications") as! [Dictionary<String, AnyObject>]))
override func viewDidLoad() { override func viewDidLoad() {
@ -37,6 +37,18 @@ class HomeViewController: UITabBarController {
let listingDict = userDict!["user_Listings"] as? [String : AnyObject] let listingDict = userDict!["user_Listings"] as? [String : AnyObject]
//sync notifications
/*if userDict!["notifications"] != nil {
self.notifications = []
for (_, v) in userDict!["notifications"] as! [String : AnyObject] {
if v["seen"] as! Bool == false {
self.notifications.append(v as! Dictionary<String, AnyObject>)
}
}
NSUserDefaults.standardUserDefaults().setObject(self.notifications, forKey: "notifications")
}*/
NSUserDefaults.standardUserDefaults().setObject(userDict!["name"] as? String, forKey: "name") NSUserDefaults.standardUserDefaults().setObject(userDict!["name"] as? String, forKey: "name")
if listingDict != nil { if listingDict != nil {
@ -204,12 +216,15 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
func listingHasEnded(fbInfo: AnyObject?, ebayInfo: AnyObject?, amazonInfo: AnyObject?, etsyInfo: AnyObject?) { func listingHasEnded(fbInfo: AnyObject?, ebayInfo: AnyObject?, amazonInfo: AnyObject?, etsyInfo: AnyObject?) {
var notificationArray: [[String: AnyObject]] = self.notifications
if (fbInfo != nil) { if (fbInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "facebook", "network": "facebook",
"message": (ebayInfo as! [String : AnyObject])["notification"] as! String, "message": (ebayInfo as! [String : AnyObject])["notification"] as! String,
"type": "ended", "type": "ended",
"seen":false,
"key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String,
"UUID": NSUUID().UUIDString "UUID": NSUUID().UUIDString
] ]
@ -217,11 +232,12 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
if (ebayInfo != nil) { if (ebayInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "ebay", "network": "ebay",
"message": (ebayInfo as! [String : AnyObject])["notification"] as! String, "message": (ebayInfo as! [String : AnyObject])["notification"] as! String,
"type": (ebayInfo as! [String : AnyObject])["type"] as! String, "type": (ebayInfo as! [String : AnyObject])["type"] as! String,
"seen":false,
"key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String,
"UUID": NSUUID().UUIDString "UUID": NSUUID().UUIDString
] ]
@ -242,11 +258,12 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
if (amazonInfo != nil) { if (amazonInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "amazon", "network": "amazon",
"message": (ebayInfo as! [String : AnyObject])["notification"] as! String, "message": (ebayInfo as! [String : AnyObject])["notification"] as! String,
"type": (ebayInfo as! [String : AnyObject])["type"] as! String, "type": (ebayInfo as! [String : AnyObject])["type"] as! String,
"seen":false,
"key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, "key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String,
"UUID": NSUUID().UUIDString "UUID": NSUUID().UUIDString
] ]
@ -254,11 +271,12 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
if (etsyInfo != nil) { if (etsyInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "etsy", "network": "etsy",
"message": (etsyInfo as! [String : AnyObject])["notification"] as! String, "message": (etsyInfo as! [String : AnyObject])["notification"] as! String,
"type": "ended", "type": "ended",
"seen":false,
"key": (etsyInfo as! [String : AnyObject])["listingKey"] as! String, "key": (etsyInfo as! [String : AnyObject])["listingKey"] as! String,
"UUID": NSUUID().UUIDString "UUID": NSUUID().UUIDString
] ]
@ -274,6 +292,10 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
listingDict!["listingStatus"] = "Ended" listingDict!["listingStatus"] = "Ended"
self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)/user_Listings/\(((etsyInfo as! [String : AnyObject])["listingKey"] as! String))").setValue(listingDict) self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)/user_Listings/\(((etsyInfo as! [String : AnyObject])["listingKey"] as! String))").setValue(listingDict)
//reload data for notifications
NSUserDefaults.standardUserDefaults().setObject(notificationArray, forKey: "notifications")
itemsView.itemTable.reloadData() itemsView.itemTable.reloadData()
}) })
} }
@ -282,21 +304,47 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
func listingHasNewNotifications(fbInfo: AnyObject?, ebayInfo: AnyObject?, amazonInfo: AnyObject?, etsyInfo: AnyObject?) { func listingHasNewNotifications(fbInfo: AnyObject?, ebayInfo: AnyObject?, amazonInfo: AnyObject?, etsyInfo: AnyObject?) {
var notificationArray: [Dictionary<String, AnyObject>] = self.notifications
if (fbInfo != nil) { if (fbInfo != nil) {
self.notifications.append( notificationArray.append(fbInfo as! [String : AnyObject])
[
"network": "facebook", self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)").observeSingleEventOfType(.Value, withBlock: {
"message": (ebayInfo as! [String : AnyObject])["notification"] as! String, (snapshot) -> Void in
"type": (ebayInfo as! [String : AnyObject])["type"] as! String,
"key": (ebayInfo as! [String : AnyObject])["listingKey"] as! String, var userDict = snapshot.value as? [String : AnyObject]
"UUID": NSUUID().UUIDString
] if (userDict!["notifications"] != nil) {
) var notificationsFir = userDict!["notifications"] as! [String : AnyObject]
notificationsFir[fbInfo!["UUID"] as! String] = fbInfo
self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)/notifications").setValue(notificationsFir, withCompletionBlock: {
(error, reference) -> Void in
if error == nil {
NSUserDefaults.standardUserDefaults().setObject(notificationArray, forKey: "notifications")
}
})
}else {
let id = (fbInfo!["UUID"] as! String)
print(id)
userDict!["notifications"] = ([ id : fbInfo as! [String:AnyObject]])
self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)").setValue(userDict, withCompletionBlock: {
(error, reference) -> Void in
if error == nil {
NSUserDefaults.standardUserDefaults().setObject(notificationArray, forKey: "notifications")
}
})
}
})
} }
if (ebayInfo != nil) { if (ebayInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "ebay", "network": "ebay",
"message": (ebayInfo as! [String : AnyObject])["notification"] as! String, "message": (ebayInfo as! [String : AnyObject])["notification"] as! String,
@ -308,7 +356,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
if (amazonInfo != nil) { if (amazonInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "amazon", "network": "amazon",
"message": (ebayInfo as! [String : AnyObject])["notification"] as! String, "message": (ebayInfo as! [String : AnyObject])["notification"] as! String,
@ -320,7 +368,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
if (etsyInfo != nil) { if (etsyInfo != nil) {
self.notifications.append( notificationArray.append(
[ [
"network": "etsy", "network": "etsy",
"message": (etsyInfo as! [String : AnyObject])["notification"] as! String, "message": (etsyInfo as! [String : AnyObject])["notification"] as! String,
@ -332,6 +380,7 @@ extension HomeViewController: ServiceNotificationManagerDelegate {
} }
//@TODO: add firbase logic to add notifications and delete already viewed notifications //@TODO: add firbase logic to add notifications and delete already viewed notifications
//reload data for notifications
} }
} }

View File

@ -1641,49 +1641,40 @@
<!--Notifications--> <!--Notifications-->
<scene sceneID="bwB-9L-Y2n"> <scene sceneID="bwB-9L-Y2n">
<objects> <objects>
<viewController title="Notifications" id="6TW-al-QKg" sceneMemberID="viewController"> <viewController title="Notifications" id="6TW-al-QKg" customClass="NotificationsViewController" customModule="Vendoo" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="bnY-Wo-CEl"> <view key="view" contentMode="scaleToFill" id="bnY-Wo-CEl">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Nv6-ae-lFl"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="69" sectionHeaderHeight="28" sectionFooterHeight="28" id="Nv6-ae-lFl">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="9G8-XI-ptI"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="notification_cell" rowHeight="69" id="9G8-XI-ptI" customClass="NotificationTableViewCell" customModule="Vendoo" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="44"/> <rect key="frame" x="0.0" y="72" width="375" height="69"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9G8-XI-ptI" id="r3f-6Q-p1g"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9G8-XI-ptI" id="r3f-6Q-p1g">
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/> <rect key="frame" x="0.0" y="0.0" width="375" height="68.5"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Item 1 Sold for $xx.xx" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vbB-Fw-hYm"> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" text="Notification message" textAlignment="natural" selectable="NO" id="cSU-p4-wQb">
<rect key="frame" x="8" y="11" width="191" height="21"/> <rect key="frame" x="8" y="0.0" width="220" height="60.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="highlightedColor"/> <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</label> </textView>
</subviews> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="pcX-cs-Mea">
</tableViewCellContentView> <rect key="frame" x="262" y="0.0" width="65" height="60.5"/>
</tableViewCell> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="JJa-O7-kym"> </imageView>
<rect key="frame" x="0.0" y="72" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="JJa-O7-kym" id="bCt-1V-IW1">
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="User 2 sent a message on x marketplace" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="0Gf-Sl-5ve">
<rect key="frame" x="8" y="11" width="326" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
</tableViewCellContentView> </tableViewCellContentView>
<connections>
<outlet property="message" destination="cSU-p4-wQb" id="H6a-7K-wX5"/>
<outlet property="network" destination="pcX-cs-Mea" id="V3q-tc-ePD"/>
</connections>
</tableViewCell> </tableViewCell>
</prototypes> </prototypes>
</tableView> </tableView>
@ -1691,9 +1682,16 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view> </view>
<navigationItem key="navigationItem" id="tMF-8P-hq8"> <navigationItem key="navigationItem" id="tMF-8P-hq8">
<barButtonItem key="leftBarButtonItem" systemItem="stop" id="nNk-we-8b0"/> <barButtonItem key="leftBarButtonItem" systemItem="stop" id="nNk-we-8b0">
<connections>
<action selector="dismissNotifications:" destination="6TW-al-QKg" id="Gka-rW-dn3"/>
</connections>
</barButtonItem>
</navigationItem> </navigationItem>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/> <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<connections>
<outlet property="notificationTable" destination="Nv6-ae-lFl" id="aqB-TZ-as0"/>
</connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="34F-M2-Thr" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="34F-M2-Thr" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
@ -1730,7 +1728,7 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Change_Pass_Cell" id="ceq-sl-ClT"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Change_Pass_Cell" id="ceq-sl-ClT">
<rect key="frame" x="0.0" y="28" width="375" height="44"/> <rect key="frame" x="0.0" y="72" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ceq-sl-ClT" id="Waq-fu-UxD"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ceq-sl-ClT" id="Waq-fu-UxD">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
@ -1747,7 +1745,7 @@
</tableViewCellContentView> </tableViewCellContentView>
</tableViewCell> </tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Delete_Account_Cell" id="Lha-cf-Sfc"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Delete_Account_Cell" id="Lha-cf-Sfc">
<rect key="frame" x="0.0" y="72" width="375" height="44"/> <rect key="frame" x="0.0" y="116" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lha-cf-Sfc" id="kmF-Sb-d0c"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Lha-cf-Sfc" id="kmF-Sb-d0c">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>

View File

@ -10,6 +10,8 @@ import UIKit
class NotificationTableViewCell: UITableViewCell { class NotificationTableViewCell: UITableViewCell {
@IBOutlet weak var message: UITextView!
@IBOutlet weak var network: UIImageView!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
// Initialization code // Initialization code

View File

@ -9,9 +9,15 @@
import UIKit import UIKit
class NotificationsViewController: UIViewController { class NotificationsViewController: UIViewController {
var notifications: [Dictionary<String, AnyObject>]! = (NSUserDefaults.standardUserDefaults().objectForKey("notifications") == nil ? [] : (NSUserDefaults.standardUserDefaults().objectForKey("notifications") as! [Dictionary<String, AnyObject>]))
var fireBase = FirebaseManager()
@IBOutlet weak var notificationTable: UITableView!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.notificationTable.dataSource = self
self.notificationTable.delegate = self
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
@ -33,3 +39,86 @@ class NotificationsViewController: UIViewController {
*/ */
} }
extension NotificationsViewController: UITableViewDelegate {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
var notification = self.notifications[indexPath.row]
switch ( notification["network"] as! String) {
case "facebook":
let alert = UIAlertController(title: "New Comment from \(notification["senderName"] as! String)", message: (notification["commentMessage"] as! String), preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "Mark as Dismissed", style: .Default, handler: {
(action) -> Void in
notification["seen"] = true
self.notifications[indexPath.row] = notification
self.fireBase.ref.child("Users/\(self.fireBase.user_email)/notifications/\(notification["UUID"] as! String)").setValue(notification, withCompletionBlock: {
(error, reference) -> Void in
if error == nil {
self.notifications = self.notifications.filter({$0["seen"] as! Bool == false})
NSUserDefaults.standardUserDefaults().setObject(self.notifications, forKey: "notifications")
self.notificationTable.reloadData()
alert.dismissViewControllerAnimated(true, completion: nil)
}
})
}))
alert.addAction(UIAlertAction(title: "OK", style: .Cancel, handler: {(action) -> Void in}))
self.presentViewController(alert, animated: true, completion: nil)
break
case "ebay":
break
case "etsy":
break
case "amazon":
break
default:
break
}
}
}
extension NotificationsViewController: UITableViewDataSource {
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: NotificationTableViewCell! = self.notificationTable.dequeueReusableCellWithIdentifier("notification_cell") as! NotificationTableViewCell
let notification = self.notifications[indexPath.row]
cell.message.text = notification["notification"] as! String
switch ( notification["network"] as! String) {
case "facebook":
cell.network.image = UIImage(named: "facebook_icon")
break
case "ebay":
cell.network.image = UIImage(named: "ebay_icon")
break
case "etsy":
cell.network.image = UIImage(named: "etsy_icon")
break
case "amazon":
break
default:
break
}
return cell
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.notifications.count
}
}
extension NotificationsViewController /*IBoutlets*/ {
@IBAction func dismissNotifications(sender: AnyObject){
let vc = self.storyboard?.instantiateViewControllerWithIdentifier("Reveal View Controller")
self.presentViewController(vc!, animated: false, completion: nil)
}
}

View File

@ -111,7 +111,59 @@ class ServiceNotificationManager: NSObject {
} }
} }
if(facebookID != nil){ if(facebookID != nil){
if(self.fbGraphManager.isAuthorized) {
self.fbGraphManager.getListingInfo ("/\(facebookID!)/comments", onCompletion: {
(listingNotificationInfo, error) -> Void in
dispatch_async(dispatch_get_main_queue(), {
self.firebaseManager.ref.child("Users/\(self.firebaseManager.user_email)").observeEventType(.Value, withBlock: {
(snapshot) -> Void in
let notifications = ((snapshot.value as? [String : AnyObject])!["notifications"]) as? [String : AnyObject]
for commentInfo in (listingNotificationInfo as! [[String: AnyObject]]) {
let fromInfo = commentInfo["from"] as! [String : AnyObject]
if notifications != nil {
if notifications![(commentInfo["id"] as! String)] == nil {
let commentDict = [
"UUID":(commentInfo["id"] as! String),
"commentMessage":(commentInfo["message"] as! String),
"network":"facebook",
"notification": "Your item \"\(listingDict!["listingTitle"] as! String)\" has a new comment.",
"key": listing.key,
"seen":false,
"senderID":(fromInfo["id"]! as! String),
"senderName":(fromInfo["name"]! as! String),
"type":"FBComment"
]
ServiceNotificationManager.delegate?.listingHasNewNotifications(commentDict, ebayInfo: nil, amazonInfo: nil, etsyInfo: nil)
}
}else{
let commentDict = [
"UUID":(commentInfo["id"] as! String),
"commentMessage":(commentInfo["message"] as! String),
"network":"facebook",
"notification": "Your item \"\(listingDict!["listingTitle"] as! String)\" has a new comment.",
"key": listing.key,
"seen":false,
"senderID":(fromInfo["id"]! as! String),
"senderName":(fromInfo["name"]! as! String),
"type":"FBComment"
]
ServiceNotificationManager.delegate?.listingHasNewNotifications(commentDict, ebayInfo: nil, amazonInfo: nil, etsyInfo: nil)
}
}
})
})
})
}
} }
if(etsyID != nil){ if(etsyID != nil){
if (self.etsyManager.isAuthorized) { if (self.etsyManager.isAuthorized) {