Manos Chorianopoulos

fix questionnaire shown at carusel

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -132,6 +132,11 @@ var timer2: DispatchSourceTimer?
if (eventArray[0] == "event") {
if (eventArray[1] == "closeArtwork") {
self.navigationController?.popViewController(animated: true)
} else if (eventArray[1] == "addUserTag") {
// SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
swiftApi().getProfileAsync(getProfileCallback)
func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
......@@ -142,6 +147,16 @@ var timer2: DispatchSourceTimer?
func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
if (campaignsData != nil) {
DispatchQueue.main.async {
let questionnaireEvent = swiftApi.QuestionnaireEventModel()
questionnaireEvent._name = String(eventArray[1])
if (eventArray.count > 2) {
questionnaireEvent._parameter = String(eventArray[2])
swiftApi().setUserTag(String(eventArray[2]))
} else {
questionnaireEvent._parameter = ""
swiftApi().setUserTag("")
}
SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
}
} else {
}
......@@ -152,19 +167,6 @@ var timer2: DispatchSourceTimer?
}
}
self.navigationController?.popViewController(animated: true)
} else if (eventArray[1] == "addUserTag") {
let questionnaireEvent = swiftApi.QuestionnaireEventModel()
questionnaireEvent._name = String(eventArray[1])
if (eventArray.count > 2) {
questionnaireEvent._parameter = String(eventArray[2])
swiftApi().setUserTag(String(eventArray[2]))
} else {
questionnaireEvent._parameter = ""
swiftApi().setUserTag("")
}
SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
} else if (eventArray[1] == "couponRetrieved") {
// let couponEvent = swiftApi.CouponEventModel()
......