Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
Fengshui-Seller-iOS
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Monika Agarwal
Fengshui-Seller-iOS
Commits
5ca567d5
Commit
5ca567d5
authored
Aug 08, 2018
by
Anand.suthar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Firebase user presence
parent
3722fdfc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
23 deletions
+48
-23
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+8
-8
Bhagyashree/Sunarc/Controller/Home/HomePageViewController.swift
+39
-14
Bhagyashree/Sunarc/Model/Home/HomeScreen/Dashboard.swift
+1
-1
No files found.
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/UserInterfaceState.xcuserstate
View file @
5ca567d5
No preview for this file type
Bhagyashree.xcworkspace/xcuserdata/sunarcmac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
5ca567d5
...
@@ -58,12 +58,12 @@
...
@@ -58,12 +58,12 @@
moduleName =
"Bhagyashree"
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5554
06002.442651
"
timestampString =
"5554
13985.959007
"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
startingLineNumber =
"22"
endingLineNumber =
"22"
endingLineNumber =
"22"
offsetFromSymbolStart =
"10
4
"
>
offsetFromSymbolStart =
"10
9
"
>
</Location>
</Location>
<Location
<Location
shouldBeEnabled =
"Yes"
shouldBeEnabled =
"Yes"
...
@@ -73,12 +73,12 @@
...
@@ -73,12 +73,12 @@
moduleName =
"Bhagyashree"
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5554
06002.446547
"
timestampString =
"5554
13985.963246
"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
startingLineNumber =
"22"
endingLineNumber =
"22"
endingLineNumber =
"22"
offsetFromSymbolStart =
"1
20
"
>
offsetFromSymbolStart =
"1
12
"
>
</Location>
</Location>
<Location
<Location
shouldBeEnabled =
"Yes"
shouldBeEnabled =
"Yes"
...
@@ -88,12 +88,12 @@
...
@@ -88,12 +88,12 @@
moduleName =
"Bhagyashree"
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5554
06002.451793
"
timestampString =
"5554
13985.967458
"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
startingLineNumber =
"22"
endingLineNumber =
"22"
endingLineNumber =
"22"
offsetFromSymbolStart =
"
424
"
>
offsetFromSymbolStart =
"
607
"
>
</Location>
</Location>
<Location
<Location
shouldBeEnabled =
"Yes"
shouldBeEnabled =
"Yes"
...
@@ -103,12 +103,12 @@
...
@@ -103,12 +103,12 @@
moduleName =
"Bhagyashree"
moduleName =
"Bhagyashree"
usesParentBreakpointCondition =
"Yes"
usesParentBreakpointCondition =
"Yes"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
urlString =
"file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString =
"5554
06002.455837
"
timestampString =
"5554
13985.971509
"
startingColumnNumber =
"9223372036854775807"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"22"
startingLineNumber =
"22"
endingLineNumber =
"22"
endingLineNumber =
"22"
offsetFromSymbolStart =
"
38
0"
>
offsetFromSymbolStart =
"
47
0"
>
</Location>
</Location>
</Locations>
</Locations>
</BreakpointContent>
</BreakpointContent>
...
...
Bhagyashree/Sunarc/Controller/Home/HomePageViewController.swift
View file @
5ca567d5
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
import
UIKit
import
UIKit
import
MJRefresh
import
MJRefresh
import
Kingfisher
import
Kingfisher
import
FirebaseDatabase
class
HomePageViewController
:
BaseViewController
{
class
HomePageViewController
:
BaseViewController
{
...
@@ -19,6 +20,22 @@ class HomePageViewController: BaseViewController {
...
@@ -19,6 +20,22 @@ class HomePageViewController: BaseViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
let
ref
=
Database
.
database
()
.
reference
()
.
child
(
"sellers"
)
ref
.
observe
(
DataEventType
.
value
)
{
(
snapshot
)
in
let
postDict
=
snapshot
.
value
as?
[
String
:
AnyObject
]
??
[:]
if
let
status
=
postDict
[
"
\(
User
.
customerId
)
"
]
as?
String
{
if
status
==
"offline"
{
User
.
isOnline
=
false
}
else
{
User
.
isOnline
=
true
}
self
.
tblSellerDashbord
.
reloadData
()
}
}
Database
.
database
()
.
reference
()
.
child
(
"sellers"
)
.
onDisconnectSetValue
([
"
\(
User
.
customerId
)
"
:
"offline"
])
let
headerForLoading
=
MJRefreshNormalHeader
{
let
headerForLoading
=
MJRefreshNormalHeader
{
self
.
dashboard
.
getDashboardData
(
success
:
{
self
.
dashboard
.
getDashboardData
(
success
:
{
self
.
tblSellerDashbord
.
reloadData
()
self
.
tblSellerDashbord
.
reloadData
()
...
@@ -152,23 +169,31 @@ class SellerProfileCell: UITableViewCell {
...
@@ -152,23 +169,31 @@ class SellerProfileCell: UITableViewCell {
if
statusSwitch
.
isOn
==
true
{
if
statusSwitch
.
isOn
==
true
{
Dashboard
.
goOnlineOffline
(
status
:
true
,
success
:
{
Database
.
database
()
.
reference
()
.
child
(
"sellers"
)
.
setValue
([
"
\(
User
.
customerId
)
"
:
"online"
])
self
.
delegate
.
showToast
(
message
:
"You are now online"
)
self
.
delegate
.
showToast
(
message
:
"You are now online"
)
self
.
lblStatus
.
text
=
"Online"
self
.
lblStatus
.
text
=
"Online"
})
{
(
message
)
in
self
.
delegate
.
showToast
(
message
:
message
)
// Dashboard.goOnlineOffline(status: true, success: {
statusSwitch
.
setOn
(
false
,
animated
:
true
)
// self.delegate.showToast(message: "You are now online")
}
// self.lblStatus.text = "Online"
// }) { (message) in
// self.delegate.showToast(message: message)
// statusSwitch.setOn(false, animated: true)
// }
}
else
{
}
else
{
Dashboard
.
goOnlineOffline
(
status
:
false
,
success
:
{
Database
.
database
()
.
reference
()
.
child
(
"sellers"
)
.
setValue
([
"
\(
User
.
customerId
)
"
:
"offline"
])
self
.
delegate
.
showToast
(
message
:
"You are now offline"
)
self
.
delegate
.
showToast
(
message
:
"You are now offline"
)
self
.
lblStatus
.
text
=
"Offline"
self
.
lblStatus
.
text
=
"Offline"
})
{
(
message
)
in
self
.
delegate
.
showToast
(
message
:
message
)
// Dashboard.goOnlineOffline(status: false, success: {
statusSwitch
.
setOn
(
true
,
animated
:
true
)
// self.delegate.showToast(message: "You are now offline")
}
// self.lblStatus.text = "Offline"
// }) { (message) in
// self.delegate.showToast(message: message)
// statusSwitch.setOn(true, animated: true)
// }
}
}
...
...
Bhagyashree/Sunarc/Model/Home/HomeScreen/Dashboard.swift
View file @
5ca567d5
...
@@ -62,7 +62,7 @@ class Dashboard {
...
@@ -62,7 +62,7 @@ class Dashboard {
if
let
sellerData
=
response
[
"seller_data"
]
as?
[
String
:
Any
]
{
if
let
sellerData
=
response
[
"seller_data"
]
as?
[
String
:
Any
]
{
User
.
profileImage
=
sellerData
[
"seller_logo"
]
as?
String
User
.
profileImage
=
sellerData
[
"seller_logo"
]
as?
String
User
.
isOnline
=
sellerData
[
"active_seller_status"
]
as!
Bool
//
User.isOnline = sellerData["active_seller_status"] as! Bool
User
.
title
=
sellerData
[
"title"
]
as?
String
User
.
title
=
sellerData
[
"title"
]
as?
String
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment