Skip to content

Commit

Permalink
add badge_value check to default enum case
Browse files Browse the repository at this point in the history
  • Loading branch information
belleklaviyo committed Dec 18, 2024
1 parent a5963ac commit 06c945a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/KlaviyoSwiftExtension/KlaviyoExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ public enum KlaviyoExtensionSDK {
}
bestAttemptContent.badge = (badgeValue as NSNumber)
}
default: break
default:
if let badgeValue = bestAttemptContent.userInfo["badge_value"] as? Int {
if let userDefaults = UserDefaults(suiteName: Bundle.main.object(forInfoDictionaryKey: "Klaviyo_App_Group") as? String) {
userDefaults.set(badgeValue, forKey: "badgeCount")
}
bestAttemptContent.badge = (badgeValue as NSNumber)
}
}
}

Expand Down

0 comments on commit 06c945a

Please sign in to comment.