Open Mihai-github opened 1 month ago
I encounter same issue. :(
Before everything works fine.
From my side. I can do the purchase.
Only error get the error "Error: An unknown error occurred" from requestSubscription when I try to downgrade
"react-native": "0.72.4", "react-native-iap": "^12.13.1",
From my side. I can do the purchase.
Only error get the error "Error: An unknown error occurred" from requestSubscription when I try to downgrade
"react-native": "0.72.4", "react-native-iap": "^12.13.1",
React Native: 0.67.4 React-native-iap: 12.13.1 on StoreKit 2
Experiencing the same unknown error.
[Error: Purchased failed for sku:*Product ID Here*: Unable to Complete Request]
In my case, trying to downgrade from an Annual duration sub to a monthly duration - within the same subscription group. Upgrading the same products works fine.
This was working on our previous setup using react-native-iap@10.1.3 on StoreKit 1
Do anyone think this is the issue from Apple's sandbox env :D
{"error": [Error: Purchased failed for sku:: Unable to Complete Request], "success": false} i am facing same error. Do you find any solution .@mharrison-nzme
tried the below versions of the library:
React Native: 0.67.4
For the above, I am getting the same error message: [Error: Purchased failed for name_of_the_product: Unable to Complete Request]
Only getting this with iOS, android seems to be working as expected.
@ivannzme this does not work.i tried all these mentioned version . "react-native": "0.72.1", I am getting product in ios but when i request for subscription it through this error {"error": [Error: Purchased failed for sku:fc_month_179: Unable to Complete Request], "success": false}
I have very limited time to contribute to this repo, so I consulted ChatGPT for assistance. Below are the details provided by ChatGPT, addressing both StoreKit1 and StoreKit2 scenarios as I am unsure which version you are using.
Invalid Product ID:
sku
(product identifier) is correctly defined and matches the one set up in App Store Connect.Sandbox Environment Issues:
Configuration Mismatches:
Subscription Handling:
Ensure validProducts
Contains the Correct Products:
if let product = validProducts.value[sku] {
// Proceed with the purchase
} else {
// Handle invalid product ID
}
Check for SKPaymentDiscount
:
if let discountOffer = discountOffer,
let identifier = discountOffer["identifier"],
let keyIdentifier = discountOffer["keyIdentifier"],
let nonce = discountOffer["nonce"],
let signature = discountOffer["signature"],
let timestamp = discountOffer["timestamp"] {
let discount = SKPaymentDiscount(
identifier: identifier,
keyIdentifier: keyIdentifier,
nonce: UUID(uuidString: nonce)!,
signature: signature,
timestamp: NSNumber(value: Int(timestamp)!)
)
payment.paymentDiscount = discount
}
Fetch Product Correctly:
let product: Product? = await productStore.getProduct(productID: sku)
if let product = product {
// Proceed with the purchase
} else {
// Handle invalid product ID
}
Check and Apply Purchase Options:
if let offerID = offerID,
let keyID = keyID,
let nonce = nonce,
let nonce = UUID(uuidString: nonce),
let signature = signature,
let signature = signature.data(using: .utf8),
let timestamp = timestamp,
let timestamp = Int(timestamp) {
options.insert(.promotionalOffer(
offerID: offerID,
keyID: keyID,
nonce: nonce,
signature: signature,
timestamp: timestamp
))
}
Enable Detailed Logging:
debugMessage("Logging detailed steps for purchase process...")
Test Different Scenarios:
Check for Known Issues:
By carefully reviewing the code for potential issues, ensuring configurations are correct, and adding detailed logging, you can better understand and resolve the errors related to in-app purchases. If these steps do not resolve the issue, consider sharing detailed logs and the specific error messages received during the purchase process for further assistance.
I hope this helps!
From my side. I can do the purchase. Only error get the error "Error: An unknown error occurred" from requestSubscription when I try to downgrade "react-native": "0.72.4", "react-native-iap": "^12.13.1",
React Native: 0.67.4 React-native-iap: 12.13.1 on StoreKit 2
Experiencing the same unknown error.
[Error: Purchased failed for sku:*Product ID Here*: Unable to Complete Request]
In my case, trying to downgrade from an Annual duration sub to a monthly duration - within the same subscription group. Upgrading the same products works fine.
This was working on our previous setup using react-native-iap@10.1.3 on StoreKit 1
It seems this issue has now been resolved for me, I did not make any code changes. Tested 3x downgrade scenarios yesterday and all completed successfully. Starting to wonder if it was Apple sandbox subscriptions service that had the issue.
From my side. I can do the purchase. Only error get the error "Error: An unknown error occurred" from requestSubscription when I try to downgrade "react-native": "0.72.4", "react-native-iap": "^12.13.1",
React Native: 0.67.4 React-native-iap: 12.13.1 on StoreKit 2 Experiencing the same unknown error.
[Error: Purchased failed for sku:*Product ID Here*: Unable to Complete Request]
In my case, trying to downgrade from an Annual duration sub to a monthly duration - within the same subscription group. Upgrading the same products works fine. This was working on our previous setup using react-native-iap@10.1.3 on StoreKit 1It seems this issue has now been resolved for me, I did not make any code changes. Tested 3x downgrade scenarios yesterday and all completed successfully. Starting to wonder if it was Apple sandbox subscriptions service that had the issue.
its worked thanks
Description
Trying to downgrade a subscription is not working, but upgrading works fine.
Expected Behavior
Be able to upgrade and downgrade subscriptions.
Screenshots
Environment:
To Reproduce Steps to reproduce the behavior:
Both subscriptions are in the same group, and have the same subscription duration of 1 month but they have different prices
While downgrading and passing to the requestSubscription promise the SKU for the cheaper subscription an error occurred which also triggered the purchaseErrorListener.
This is the error from the purcahseErrorListener:
[Optional] Additional Context
While debugging and inspecting my SANDBOX account, I noticed an interesting discrepancy: although the code caught an error during the subscription downgrade process, my account displays the subscription as active, despite the failure.