Replies: 2 comments
-
ProblemA 14-day free trial was incorrectly mapped as: {
"introductoryPriceNumberOfPeriodsIOS": "1",
"introductoryPriceSubscriptionPeriodIOS": "day"
}Instead of the expected: {
"introductoryPriceNumberOfPeriodsIOS": "2",
"introductoryPriceSubscriptionPeriodIOS": "week"
}Root CauseStoreKit 2 represents periods with both
However, OpenIAP was using only the FixAdded Supported Conversions: From Days
From Weeks
From Months
Note: Month conversions from days/weeks are intentionally avoided because calendar months have variable lengths (28-31 days), which could lead to incorrect period representations. ExamplesFree Trial (periodCount = 1):
Pay-as-you-go (periodCount > 1):
Result: Both free trials and pay-as-you-go offers now show correct total periods ✅ |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the fix 🙏 that was quick! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug Description
After migrating from react-native-iap versions 12/13 to version 14, the iOS subscription free trial period mapping is incorrect. A 14-day (2-week) free trial is being mapped as:
introductoryPriceNumberOfPeriodsIOS: "1"introductoryPriceSubscriptionPeriodIOS: "day"Instead of the expected:
introductoryPriceNumberOfPeriodsIOS: "2"introductoryPriceSubscriptionPeriodIOS: "week"Environment
Expected vs Actual Behavior
Expected for 14-day free trial:
{ "introductoryPriceNumberOfPeriodsIOS": "2", "introductoryPriceSubscriptionPeriodIOS": "week" }Actual (after migration):
{ "introductoryPriceNumberOfPeriodsIOS": "1", "introductoryPriceSubscriptionPeriodIOS": "day" }Evidence from StoreKit Raw Data
The
jsonRepresentationIOSfield shows the correct Storekit 2 data:jsonRepresentationIOS
{"attributes":{"description":{"standard":"Pro"},"editorialArtwork":{},"icuLocale":"pl_PL@currency=PLN","isFamilyShareable":0,"isMerchandisedEnabled":0,"isMerchandisedVisibleByDefault":0,"isSubscription":1,"kind":"Auto-Renewable Subscription","name":"SmartWorkout Pro","offerName":"com.arkadiuszchr.SmartWorkout.pro.yearly","offers":[{"assets":[],"buyParams":"productType=A&price=159990&salableAdamId=1578674504&pricingParameters=STDQ&pg=bruno_pln&offerName=com.arkadiuszchr.SmartWorkout.pro.yearly&appAdamId=1510802814","currencyCode":"PLN","discounts":[{"modeType":"FreeTrial","numOfPeriods":1,"price":0,"priceFormatted":"0,00 zł","priceString":"0","recurringSubscriptionPeriod":"P14D","type":"IntroOffer"}],"price":159.99000000000001,"priceFormatted":"159,99 zł","priceString":"159.99","recurringSubscriptionPeriod":"P1Y","type":"buy"}],"releaseDate":"2009-06-17","subscriptionFamilyId":"20857400","subscriptionFamilyName":"Subskrypcja","subscriptionFamilyRank":8,"supportsRuntimePricing":0,"url":"https:\/\/sandbox.itunes.apple.com\/pl\/app\/smartworkout-pro\/id1510802814?l=pl"},"href":"\/v1\/catalog\/pl\/in-apps\/1578674504?l=pl","id":"1578674504","type":"in-apps"}{ "discounts": [{ "modeType": "FreeTrial", "numOfPeriods": 1, "price": 0, "priceFormatted": "0,00 zł", "priceString": "0", "recurringSubscriptionPeriod": "P14D", "type": "IntroOffer" }] }Beta Was this translation helpful? Give feedback.
All reactions