Recently we’ve started integrate the Offering Metadata feature. As this is a beta feature, I believe there is a minor bug in the SDK.
Reproduction Steps:
- Add an integer property into metadata of the offering using RevenueCat dashboard (“myProperty” : 123)
- Try to read the the integer value using in Swift code:
offering?.getMetadataValue(for: "myProperty", default: -1)
-
The value defaults to -1 rather than 123
When I checked the SDK code, I see that the metadata
dictionary returned as [“myProperty: “123”]
. Then getMetadataValue<T>(for key: String, default: T) -> T
function is failing to cast the value to Int even though generic value T is set to Int in above call.
It is not a major issue as I can achieve casting in my code but wanted to report it here.
I am using:
Swift 5
Xcode 14.3.1
RevenueCat 4.25.0