Manos Chorianopoulos

fix supermarket coupon sharing popup text

...@@ -3392,7 +3392,8 @@ public class swiftApi { ...@@ -3392,7 +3392,8 @@ public class swiftApi {
3392 DispatchQueue.main.async { 3392 DispatchQueue.main.async {
3393 if (sharingData?._status_outer == 1) { 3393 if (sharingData?._status_outer == 1) {
3394 if (sharingData?._status != nil && sharingData?._status != "" && sharingData?._status == "pending") { 3394 if (sharingData?._status != nil && sharingData?._status != "" && sharingData?._status == "pending") {
3395 - self.initialSharingDialog(controller, "Συγχαρητήρια!", sharingData?._modal_text ?? "", sharingId) 3395 + let couponsetType = sharingData?._couponset_type ?? ""
3396 + self.initialSharingDialog(controller, "Συγχαρητήρια!", sharingData?._modal_text ?? "", sharingId, couponsetType)
3396 3397
3397 } else if (sharingData?._status != nil && sharingData?._status != "" && sharingData?._status == "reject") { 3398 } else if (sharingData?._status != nil && sharingData?._status != "" && sharingData?._status == "reject") {
3398 self.returnSharingDialog(controller, sharingData?._modal_text ?? "") 3399 self.returnSharingDialog(controller, sharingData?._modal_text ?? "")
...@@ -3414,7 +3415,7 @@ public class swiftApi { ...@@ -3414,7 +3415,7 @@ public class swiftApi {
3414 } 3415 }
3415 } 3416 }
3416 3417
3417 - func initialSharingDialog(_ controller: UIViewController, _ alertHeaderTitle: String, _ alertTitle: String, _ sharingId: String) -> Void { 3418 + func initialSharingDialog(_ controller: UIViewController, _ alertHeaderTitle: String, _ alertTitle: String, _ sharingId: String, _ couponsetType: String) -> Void {
3418 3419
3419 let alert = UIAlertController(title: alertHeaderTitle, message: alertTitle, preferredStyle: .alert) 3420 let alert = UIAlertController(title: alertHeaderTitle, message: alertTitle, preferredStyle: .alert)
3420 3421
...@@ -3458,7 +3459,7 @@ public class swiftApi { ...@@ -3458,7 +3459,7 @@ public class swiftApi {
3458 DispatchQueue.main.async { 3459 DispatchQueue.main.async {
3459 3460
3460 if (sharingData?.getStatus == 1) { 3461 if (sharingData?.getStatus == 1) {
3461 - self.acceptSharingDialog(controller) 3462 + self.acceptSharingDialog(controller, couponsetType)
3462 3463
3463 swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in }) 3464 swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
3464 3465
...@@ -3549,9 +3550,16 @@ public class swiftApi { ...@@ -3549,9 +3550,16 @@ public class swiftApi {
3549 } 3550 }
3550 } 3551 }
3551 3552
3552 - func acceptSharingDialog(_ controller: UIViewController) -> Void { 3553 + func acceptSharingDialog(_ controller: UIViewController, _ couponsetType: String) -> Void {
3553 3554
3554 - let alert = UIAlertController(title: "Συγχαρητήρια!", message: "Το δώρο σου ενεργοποιήθηκε επιτυχώς στο My Rewards!", preferredStyle: .alert) 3555 + var alertMessage = ""
3556 + if (couponsetType != "" && couponsetType == "supermarket") {
3557 + alertMessage = "Το δώρο σου ενεργοποιήθηκε επιτυχώς στο καλάθι του SuperMarket Deals!"
3558 + } else {
3559 + alertMessage = "Το δώρο σου ενεργοποιήθηκε επιτυχώς στο My Rewards!"
3560 + }
3561 +
3562 + let alert = UIAlertController(title: "Συγχαρητήρια!", message: alertMessage, preferredStyle: .alert)
3555 alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in 3563 alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
3556 switch action.style{ 3564 switch action.style{
3557 case .default: 3565 case .default:
...@@ -4931,12 +4939,14 @@ public class swiftApi { ...@@ -4931,12 +4939,14 @@ public class swiftApi {
4931 private var status: String 4939 private var status: String
4932 private var status_outer: Int 4940 private var status_outer: Int
4933 private var msg: String 4941 private var msg: String
4942 + private var couponset_type: String
4934 4943
4935 init() { 4944 init() {
4936 self.modal_text = "" 4945 self.modal_text = ""
4937 self.status = "" 4946 self.status = ""
4938 self.status_outer = -1 4947 self.status_outer = -1
4939 self.msg = "" 4948 self.msg = ""
4949 + self.couponset_type = ""
4940 } 4950 }
4941 4951
4942 init(dictionary: [String: Any]) { 4952 init(dictionary: [String: Any]) {
...@@ -4946,6 +4956,7 @@ public class swiftApi { ...@@ -4946,6 +4956,7 @@ public class swiftApi {
4946 4956
4947 self.status_outer = dictionary["status"] as? Int ?? -1 4957 self.status_outer = dictionary["status"] as? Int ?? -1
4948 self.msg = dictionary["msg"] as? String ?? "" 4958 self.msg = dictionary["msg"] as? String ?? ""
4959 + self.couponset_type = dictionary["couponset_type"] as? String ?? ""
4949 } 4960 }
4950 4961
4951 public var _modal_text: String { 4962 public var _modal_text: String {
...@@ -4983,6 +4994,15 @@ public class swiftApi { ...@@ -4983,6 +4994,15 @@ public class swiftApi {
4983 self.msg = newValue 4994 self.msg = newValue
4984 } 4995 }
4985 } 4996 }
4997 +
4998 + public var _couponset_type: String {
4999 + get { // getter
5000 + return self.couponset_type
5001 + }
5002 + set(newValue) { //setter
5003 + self.couponset_type = newValue
5004 + }
5005 + }
4986 } 5006 }
4987 5007
4988 5008
......