-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
buyProductWithOfferIOS fails with E_UNKNOWN error #516
Comments
Thanks @hyochan. I'm able to consistently connect to the iTunes store and make a regular purchase transaction (via |
@cl2205 That's bit strange since the error message is |
@hyochan here you go (using mock offer data here): // Purchase with Subscription Offer
const offer = {
identifier: 'TESTOFFER', // from iTunes products discounts array
keyIdentifier: 'MYK3Y1D' // from server,
nonce: <nonce>, // from server
signature: <base64-encoded-string>, // from server
timestamp: 1560290457029 // from server
};
const sku = 'com.myteam.myapp.iap.monthly';
const uid = <applicationUsername-string>; // I've tried using both empty str and non-empty str values here. This is an optional string value for `applicationUsername` that can be an empty str as noted in the server signature docs: https://developer.apple.com/documentation/storekit/in-app_purchase/generating_a_signature_for_subscription_offers?language=objc
const products = await loadProducts(); // this is successful
const response = await RNIap.buyProductWithOfferIOS(sku, uid, offer); // StoreKit shows discount is applied but when confirming the purchase, transaction fails w/ above error
---------
// Regular Purchase
const sku = 'com.myteam.myapp.iap.monthly';
const response = await RNIap.buySubscription(sku); // this is successful |
@hyochan thanks for sharing that thread! I do seem to have resolved the issue of getting that particular alert of Unfortunately another issue I'm running into now is that the transaction still fails. Now I'm getting the system success modal of ' |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
How did you fix |
Version of react-native-iap
2.5.5
Version of react-native
0.59.3
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
A purchase with an Apple Subscription Offer discount applied should succeed with some feedback, ie. 'Purchase was successful' modal from StoreKit. The discount transaction should also be reflected in the ios receipt thereafter.
Actual behavior
I'm able to get up to getting the StoreKit modals for seeing the correct discount price from the subscription offer and confirming the subscription, but it fails at the end w/ this Alert modal:
Unable to Purchase
Contact the developer for more information.
Can also confirm that the transaction is also missing from the iOS receipt.
On the other hand, I can confirm that a regular purchase transaction without any subscription offer succeeds in the current sandbox environment and am able to connect to the iTunes Store.
Here's the error stack:
Tested environment (Emulator? Real Device?)
On a real device using a Sandbox account
Steps to reproduce the behavior
nonce
,timestamp
, andkeyIdentifier
productId
,uid
, andoffer
The text was updated successfully, but these errors were encountered: