Skip to content

Commit

Permalink
chore: code refactor (RMCCX-6702)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoumenRautray committed Aug 1, 2024
1 parent 6887b63 commit 00a9a65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/RInAppMessaging/CampaignsValidator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal struct CampaignsValidator: CampaignsValidatorType {
return
}

guard !(campaign.isPushPrimer && isNotificationsAllowed()) else {
guard campaign.pushPrimerEnabled && !isNotificationsAuthorized() else {
return
}

Expand Down Expand Up @@ -99,7 +99,7 @@ internal struct CampaignsValidator: CampaignsValidatorType {
return triggeredEvents
}

private func isNotificationsAllowed() -> Bool {
private func isNotificationsAuthorized() -> Bool {
let semaphore = DispatchSemaphore(value: 0)
var authorizationStatus: UNAuthorizationStatus = .notDetermined

Expand Down
2 changes: 1 addition & 1 deletion Sources/RInAppMessaging/Models/Responses/Campaign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal struct Campaign: Codable, Hashable {
String(substring.drop(while: { $0 != "["}).dropFirst())
}.filter { !$0.isEmpty }
}
var isPushPrimer: Bool {
var pushPrimerEnabled: Bool {
return RInAppMessaging.isRMCEnvironment && data.customJson?.pushPrimer?.button != nil
}

Expand Down

0 comments on commit 00a9a65

Please sign in to comment.