cordova-plugin-purchase icon indicating copy to clipboard operation
cordova-plugin-purchase copied to clipboard

iOS Auto Renew Subscriptions Discounts

Open alessandrobarbetti opened this issue 3 years ago • 3 comments

Hi I've tried to implement ios auto-renew subscriptions discounts with cordova-plugin-purchase, but I'couldnt find a way to make it work.

I correctly see discounts array inside store.product[n] the object does not contain the eligibility attribute, not even if the customer is eligible

I do not understand wich is the correct way to pass discount data to store.order().

discount, a object that describes the discount to apply with the purchase (iOS only):
/// - id, discount identifier
/// - key, key identifier
/// - nonce, uuid value for the nonce
/// - timestamp, time at which the signature was generated (in milliseconds since epoch)
/// - signature, cryptographic signature that unlock the discount

I could easily find id attribute inside discount object but other attributes are not present and I couldn't find documentation on where to take them.

These are the commits that implement the feature for more details: https://github.com/j3k0/cordova-plugin-purchase/pull/939

alessandrobarbetti avatar Apr 25 '21 08:04 alessandrobarbetti

Hello,

I am confused too. If I pass the discount ID or the full object discount from the product, it still does not work. Is it possible to explain this part?

Thank you

soramister avatar Jun 19 '21 09:06 soramister

This video is straight from Apple: https://developer.apple.com/videos/play/wwdc2019/305

And this repo is a sample of the same task using the Cordova Purchase Plugin: https://github.com/j3k0/nodejs-suboffer-signature-server

Though at the moment, after following these steps pretty closely and getting a successful response from a purchase that includes a discount, none of the discounts seem to go into effect during the purchase.

jonah-butler avatar Apr 01 '22 19:04 jonah-butler

anyone found any solution?

pedrumgolriz avatar Jun 27 '23 16:06 pedrumgolriz