-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add missing conn for SK2 intro offers #2630
Conversation
Not sure who to ping for this but it seems the failing check is on a diff of swift files but none were changed in this PR. |
@Shaw-Signaturize, thanks so much for this, I ran into this myself and came up with a similar solution, but I wasn't sure if it was a result of not using RNIAP as intended. The type for SubscriptionIOS looks like this: export interface SubscriptionIOS extends ProductCommon {
platform: SubscriptionPlatform.ios;
type: 'subs';
discounts?: Discount[];
introductoryPrice?: string;
introductoryPriceAsAmountIOS?: string;
introductoryPricePaymentModeIOS?:
| ''
| 'FREETRIAL'
| 'PAYASYOUGO'
| 'PAYUPFRONT';
introductoryPriceNumberOfPeriodsIOS?: string;
introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;
subscriptionPeriodNumberIOS?: string;
subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;
} I think what you have assigned to
I believe that would make the proper change the following: {
// unchanged fields above
introductoryPrice: subscription?.introductoryOffer?.displayPrice,
introductoryPriceAsAmountIOS: subscription?.introductoryOffer?.price.toString(),
introductoryPricePaymentModeIOS:
subscription?.introductoryOffer?.paymentMode.toUpperCase() as
| ''
| 'FREETRIAL'
| 'PAYASYOUGO'
| 'PAYUPFRONT',
introductoryPriceNumberOfPeriodsIOS:
subscription?.introductoryOffer?.period?.value?.toString(),
introductoryPriceSubscriptionPeriodIOS: subscription?.introductoryOffer
?.period?.unit as SubscriptionIosPeriod,
} Since the library also returns |
@LectricAvenue |
@Shaw-Signaturize of course! I agree that potentially they intended to remove these, although surely they didn't mean to leave out the intro offer details entirely. The docs seem very outdated, but in the source code I see lots of documentation markup that doesn't seem to be available on the website? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you kindly check ci failing?
As mentioned above the CI seems to be failing when verifying that certain swift files have not changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased codebase myself~
Let's see how this code works!
Thanks. The help is much appreciated |
Adding missing mapping for intro offers in storekit2 on existing type
Adding missing mapping for intro offers in storekit2 on existing type