Showing
1 changed file
with
7 additions
and
3 deletions
... | @@ -45,11 +45,15 @@ import SwiftEventBus | ... | @@ -45,11 +45,15 @@ import SwiftEventBus |
45 | } else if (eventArray[1] == "addUserTag") { | 45 | } else if (eventArray[1] == "addUserTag") { |
46 | let questionnaireEvent = swiftApi.QuestionnaireEventModel() | 46 | let questionnaireEvent = swiftApi.QuestionnaireEventModel() |
47 | questionnaireEvent._name = String(eventArray[1]) | 47 | questionnaireEvent._name = String(eventArray[1]) |
48 | - questionnaireEvent._parameter = String(eventArray[2]) | 48 | + if (eventArray.count > 2) { |
49 | + questionnaireEvent._parameter = String(eventArray[2]) | ||
50 | + swiftApi().setUserTag(String(eventArray[2])) | ||
51 | + } else { | ||
52 | + questionnaireEvent._parameter = "" | ||
53 | + swiftApi().setUserTag("") | ||
54 | + } | ||
49 | SwiftEventBus.post("questionnaire", sender: questionnaireEvent) | 55 | SwiftEventBus.post("questionnaire", sender: questionnaireEvent) |
50 | 56 | ||
51 | - swiftApi().setUserTag(String(eventArray[2])) | ||
52 | - | ||
53 | } else if (eventArray[1] == "couponRetrieved") { | 57 | } else if (eventArray[1] == "couponRetrieved") { |
54 | let couponEvent = swiftApi.CouponEventModel() | 58 | let couponEvent = swiftApi.CouponEventModel() |
55 | SwiftEventBus.post("coupon_retrieved", sender: couponEvent) | 59 | SwiftEventBus.post("coupon_retrieved", sender: couponEvent) | ... | ... |
-
Please register or login to post a comment