Skip to content

Commit

Permalink
spimto win timing
Browse files Browse the repository at this point in the history
  • Loading branch information
thebei3 committed Jul 5, 2024
1 parent 25f86d4 commit 2c63ac6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 37eb5f3e9a2f3ac48e581d087a56e280a7f7889b

COCOAPODS: 1.15.2
COCOAPODS: 1.12.1
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,13 @@ class VisilabsInAppNotifications: VisilabsNotificationViewControllerDelegate {
}

func showSpinToWin(_ model: SpinToWinViewModel) -> Bool {
let spinToWinVC = SpinToWinViewController(model)
spinToWinVC.delegate = self
spinToWinVC.show(animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + Double(model.waitingTime), execute: {

let spinToWinVC = SpinToWinViewController(model)
spinToWinVC.delegate = self
spinToWinVC.show(animated: true)
})

return true
}

Expand Down
1 change: 1 addition & 0 deletions Sources/TargetingAction/SpinToWinModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public struct SpinToWinViewModel: TargetingActionViewModel, Codable {
var wheelSpinAction:String
var promocodesSoldoutMessage: String
var copyButtonFunction: String
var waitingTime: Int

// ExtendedProps
var displaynameTextColor: String
Expand Down
3 changes: 2 additions & 1 deletion Sources/TargetingAction/VisilabsTargetingAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class VisilabsTargetingAction {
let sliceCount = actionData[VisilabsConstants.sliceCount] as? String ?? ""
let promocodesSoldoutMessage = actionData[VisilabsConstants.promocodesSoldoutMessage] as? String ?? ""
let copyButtonFunction = actionData[VisilabsConstants.copyButtonFunction] as? String ?? "copy"
let waitingTime = actionData[VisilabsConstants.waitingTime] as? Int ?? 0

// report
let impression = report[VisilabsConstants.impression] as? String ?? ""
Expand Down Expand Up @@ -279,7 +280,7 @@ class VisilabsTargetingAction {
sliceArray.append(spinToWinSliceViewModel)
}

let model = SpinToWinViewModel(targetingActionType: .spinToWin, actId: actid, auth: auth, promoAuth: promoAuth, type: type, title: title, message: message, placeholder: placeholder, buttonLabel: buttonLabel, consentText: consentText, emailPermitText: emailPermitText, successMessage: successMessage, invalidEmailMessage: invalidEmailMessage, checkConsentMessage: checkConsentMessage, promocodeTitle: promocodeTitle, copyButtonLabel: copybuttonLabel, mailSubscription: mailSubscription, sliceCount: sliceCount, slices: sliceArray, report: spinToWinReport, taTemplate: taTemplate, img: img, wheelSpinAction: wheelSpinAction, promocodesSoldoutMessage: promocodesSoldoutMessage, copyButtonFunction: copyButtonFunction, displaynameTextColor: displaynameTextColor, displaynameFontFamily: displaynameFontFamily, displaynameTextSize: displaynameTextSize, titleTextColor: titleTextColor, titleFontFamily: titleFontFamily, titleTextSize: titleTextSize, textColor: textColor, textFontFamily: textFontFamily, textSize: textSize, buttonColor: button_color, buttonTextColor: button_text_color, buttonFontFamily: buttonFontFamily, buttonTextSize: buttonTextSize, promocodeTitleTextColor: promocodeTitleTextColor, promocodeTitleFontFamily: promocodeTitleFontFamily, promocodeTitleTextSize: promocodeTitleTextSize, promocodeBackgroundColor: promocodeBackgroundColor, promocodeTextColor: promocodeTextColor, copybuttonColor: copybuttonColor, copybuttonTextColor: copybuttonTextColor, copybuttonFontFamily: copybuttonFontFamily, copybuttonTextSize: copybuttonTextSize, emailpermitTextSize: emailpermitTextSize, emailpermitTextUrl: emailpermitTextUrl, consentTextSize: consentTextSize, consentTextUrl: consentTextUrl, closeButtonColor: closeButtonColor, backgroundColor: backgroundColor,wheelBorderWidth: wheelBorderWidth,wheelBorderColor: wheelBorderColor,sliceDisplaynameFontFamily: sliceDisplaynameFontFamily, promocodesSoldoutMessageTextColor: promocodesSoldoutMessageTextColor, promocodesSoldoutMessageFontFamily: promocodesSoldoutMessageFontFamily, promocodesSoldoutMessageTextSize: promocodesSoldoutMessageTextSize, promocodesSoldoutMessageBackgroundColor: promocodesSoldoutMessageBackgroundColor,displaynameCustomFontFamilyIos:displaynameCustomFontFamilyIos ,titleCustomFontFamilyIos:titleCustomFontFamilyIos,textCustomFontFamilyIos:textCustomFontFamilyIos,buttonCustomFontFamilyIos:buttonCustomFontFamilyIos,promocodeTitleCustomFontFamilyIos:promocodeTitleCustomFontFamilyIos,copybuttonCustomFontFamilyIos:copybuttonCustomFontFamilyIos,promocodesSoldoutMessageCustomFontFamilyIos:promocodesSoldoutMessageCustomFontFamilyIos, titlePosition: titlePosition, textPosition: textPosition, buttonPosition: buttonPosition, copybuttonPosition: copybuttonPosition, promocodeBannerText: promocodeBannerText, promocodeBannerTextColor: promocodeBannerTextColor, promocodeBannerBackgroundColor: promocodeBannerBackgroundColor, promocodeBannerButtonLabel: promocodeBannerButtonLabel, displaynameTextAlign: displaynameTextAlign)
let model = SpinToWinViewModel(targetingActionType: .spinToWin, actId: actid, auth: auth, promoAuth: promoAuth, type: type, title: title, message: message, placeholder: placeholder, buttonLabel: buttonLabel, consentText: consentText, emailPermitText: emailPermitText, successMessage: successMessage, invalidEmailMessage: invalidEmailMessage, checkConsentMessage: checkConsentMessage, promocodeTitle: promocodeTitle, copyButtonLabel: copybuttonLabel, mailSubscription: mailSubscription, sliceCount: sliceCount, slices: sliceArray, report: spinToWinReport, taTemplate: taTemplate, img: img, wheelSpinAction: wheelSpinAction, promocodesSoldoutMessage: promocodesSoldoutMessage, copyButtonFunction: copyButtonFunction, waitingTime: waitingTime, displaynameTextColor: displaynameTextColor, displaynameFontFamily: displaynameFontFamily, displaynameTextSize: displaynameTextSize, titleTextColor: titleTextColor, titleFontFamily: titleFontFamily, titleTextSize: titleTextSize, textColor: textColor, textFontFamily: textFontFamily, textSize: textSize, buttonColor: button_color, buttonTextColor: button_text_color, buttonFontFamily: buttonFontFamily, buttonTextSize: buttonTextSize, promocodeTitleTextColor: promocodeTitleTextColor, promocodeTitleFontFamily: promocodeTitleFontFamily, promocodeTitleTextSize: promocodeTitleTextSize, promocodeBackgroundColor: promocodeBackgroundColor, promocodeTextColor: promocodeTextColor, copybuttonColor: copybuttonColor, copybuttonTextColor: copybuttonTextColor, copybuttonFontFamily: copybuttonFontFamily, copybuttonTextSize: copybuttonTextSize, emailpermitTextSize: emailpermitTextSize, emailpermitTextUrl: emailpermitTextUrl, consentTextSize: consentTextSize, consentTextUrl: consentTextUrl, closeButtonColor: closeButtonColor, backgroundColor: backgroundColor,wheelBorderWidth: wheelBorderWidth,wheelBorderColor: wheelBorderColor,sliceDisplaynameFontFamily: sliceDisplaynameFontFamily, promocodesSoldoutMessageTextColor: promocodesSoldoutMessageTextColor, promocodesSoldoutMessageFontFamily: promocodesSoldoutMessageFontFamily, promocodesSoldoutMessageTextSize: promocodesSoldoutMessageTextSize, promocodesSoldoutMessageBackgroundColor: promocodesSoldoutMessageBackgroundColor,displaynameCustomFontFamilyIos:displaynameCustomFontFamilyIos ,titleCustomFontFamilyIos:titleCustomFontFamilyIos,textCustomFontFamilyIos:textCustomFontFamilyIos,buttonCustomFontFamilyIos:buttonCustomFontFamilyIos,promocodeTitleCustomFontFamilyIos:promocodeTitleCustomFontFamilyIos,copybuttonCustomFontFamilyIos:copybuttonCustomFontFamilyIos,promocodesSoldoutMessageCustomFontFamilyIos:promocodesSoldoutMessageCustomFontFamilyIos, titlePosition: titlePosition, textPosition: textPosition, buttonPosition: buttonPosition, copybuttonPosition: copybuttonPosition, promocodeBannerText: promocodeBannerText, promocodeBannerTextColor: promocodeBannerTextColor, promocodeBannerBackgroundColor: promocodeBannerBackgroundColor, promocodeBannerButtonLabel: promocodeBannerButtonLabel, displaynameTextAlign: displaynameTextAlign)

return model
}
Expand Down

0 comments on commit 2c63ac6

Please sign in to comment.