Description
Setting iconTint in updateShield / ShieldConfiguration has no visible effect. The tint color is silently ignored regardless of what value is passed.
Root Cause
In targets/ShieldConfiguration/ShieldConfigurationExtension.swift, the resolveIcon function calls withTintColor but doesn't assign the result back:
// Current (broken) — result is discarded
if let iconTint = getColor(color: dict["iconTint"] as? [String: Double]) {
image?.withTintColor(iconTint)
}
UIImage.withTintColor(_:) is not a mutating method — it returns a new UIImage. The tinted image is created and immediately thrown away, so image is returned untouched.
Fix
if let iconTint = getColor(color: dict["iconTint"] as? [String: Double]) {
image = image?.withTintColor(iconTint, renderingMode: .alwaysOriginal)
}
Using .alwaysOriginal rendering mode ensures the tint colour is preserved and not overridden by the system.
Steps to Reproduce
- Call updateShield with any iconSystemName and a non-default iconTint colour
- Trigger the shield — the icon renders in its default system colour, not the specified tint
Environment
- react-native-device-activity version: 0.5.1
Description
Setting iconTint in updateShield / ShieldConfiguration has no visible effect. The tint color is silently ignored regardless of what value is passed.
Root Cause
In
targets/ShieldConfiguration/ShieldConfigurationExtension.swift,the resolveIcon function callswithTintColorbut doesn't assign the result back:// Current (broken) — result is discarded
UIImage.withTintColor(_:)is not a mutating method — it returns a new UIImage. The tinted image is created and immediately thrown away, so image is returned untouched.Fix
Using
.alwaysOriginalrendering mode ensures the tint colour is preserved and not overridden by the system.Steps to Reproduce
Environment