We have not been receiving notifications for Apple's recurring monthly charges and user refunds since 4 PM on October 10th.
apple Id:1325419855
server notification endpoint: https://xyks-open.yuanfudao.com/leo-cm-third-pay/api/apple-iap/pay-sub-notify/2
Server notification version: version1
Additionally, we have another app, which is also using server notification version1, and it is able to receive notifications.
StoreKit
RSS for tagSupport in-app purchases and interactions with the App Store using StoreKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello,
We have been approved for the Advanced commerce API and we are trying to implement dynamically created subscriptions via the SubscriptionCreateRequest.
We followed the Sending Advanced Commerce API requests from your app (https://developer.apple.com/documentation/storekit/sending-advanced-commerce-api-requests-from-your-app) documentation but we are not able to make it work correctly.
We created a generic subscription in the Appstore connect, product ID: com.example.subscription
Then in the app we load the subscription:
try await Product.products(for: ["com.example.subscription"])
We do the JWS serialization on our backend and then we wrap the jwt and convert it to Data in the app as this:
let request = """
{
"signatureInfo": {
"token": "\(result.signedPayload)"
}
}
"""
let advancedCommerceRequestData = Data(request.utf8)
Lastly, we apply the purchase options on the generic product as this:
try await product.purchase(
options: [
Product.PurchaseOption.custom(
key: "advancedCommerceData",
value: advancedCommerceRequestData
)
]
)
It doesn't show any error, but on the payment sheet it shows the data from the generic subscription and not the data that was in the SubscriptionCreateRequest.
Here is an example of the generated jwt:
eyJraWQiOiI4V0tNQjhLWTI0IiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiI0MDZkYmEyOS04ZjIyLTQ3ZDUtYWI1Mi1kY2M2NTQ5OTE1Y2MiLCJiaWQiOiJjby5oZXJvaGVyby5IZXJvaGVybyIsImlhdCI6MTc0NjQzNTcxNCwiYXVkIjoiYWR2YW5jZWQtY29tbWVyY2UtYXBpIiwibm9uY2UiOiJhMzY2MGIwMS1kMDcyLTRlZDYtYmYyMS01MWU1Y2U5MDRmYTUiLCJyZXF1ZXN0IjoiZXlKdmNHVnlZWFJwYjI0aU9pSkRVa1ZCVkVWZlUxVkNVME5TU1ZCVVNVOU9JaXdpY21WeGRXVnpkRWx1Wm04aU9uc2ljbVZ4ZFdWemRGSmxabVZ5Wlc1alpVbGtJam9pTVdSaVlqZG1ZbVl0WWpFNE55MDBZMlJoTFRrNE16WXRNalUzTTJZeU1UaGpOekZpSW4wc0luTjBiM0psWm5KdmJuUWlPaUpEV2tVaUxDSjJaWEp6YVc5dUlqb2lNU0lzSW1OMWNuSmxibU41SWpvaVExcExJaXdpZEdGNFEyOWtaU0k2SWxNd01qRXRNRGd0TVNJc0ltUmxjMk55YVhCMGIzSnpJanA3SW1ScGMzQnNZWGxPWVcxbElqb2lVM1ZpYzJOeWFYQjBhVzl1SUZCbGRISWc0b0tzSURVaUxDSmtaWE5qY21sd2RHbHZiaUk2SWxOMVluTmpjbWx3ZEdsdmJpQlFaWFJ5SU9LQ3JDQTFJbjBzSW5CbGNtbHZaQ0k2SWxBeFRTSXNJbWwwWlcxeklqcGJleUprYVhOd2JHRjVUbUZ0WlNJNklsTjFZbk5qY21sd2RHbHZiaUJRWlhSeUlPS0NyQ0ExSWl3aVpHVnpZM0pwY0hScGIyNGlPaUpUZFdKelkzSnBjSFJwYjI0Z1VHVjBjaURpZ3F3Z05TSXNJbkJ5YVdObElqb3hOVEF3TUN3aWMydDFJam9pY1dkeGIzUnNlSEY1WVdGaFlsOTRiV3RvWlhWdGFHWjJhbXhtWDBWVlVqQTFJbjFkZlE9PSJ9.kJ0f_q2A11Mn9OBmvX6SRmtW5P--volFTVcq_Gohs3N51ECfZqS3WHOxOZc7aojq_qiUHGFp_evmHP51f3LzSw
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
In-App Purchase
Advanced Commerce API
I'm developing storekitV2, my app is providing the way to refund some product, and I use method below.
func beginRefundRequest(in scene: UIWindowScene) async throws -> Transaction.RefundRequestStatus
however when i call the method, the modal view presented but the view shows error with message 'cannot connect'. when I select retry button, something done with indicator and get same result.
how can I solve this problem?
I have an Expo React Native application and I am using react-native-iap library. I have setup the URL for sandbox and production url to receive notifications when a something happens regarding subscriptions. I am not able to receive those notifications when I simulate the purchase on the Simulator using Xcode.
I then have used the node library app-store-server-library to mock a test notification and I am receiving the test notification when I call requestTestNotification method.
below is the react-native code I am using:
import {useEffect, useState} from "react";
import {
initConnection,
Sku,
Subscription,
useIAP,
SubscriptionIOS,
requestSubscription,
PurchaseError,
clearTransactionIOS
} from "react-native-iap";
import styles from "@/screens/IAP/IAPStyles";
import CustomText from "@/components/CustomText";
import Heading from "@/components/Heading";
import subscriptionsProducts from "@/utilities/products";
function IAPScreen() {
const [isPurchasing, setIsPurchasing] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
const { subscriptions, currentPurchase, finishTransaction, getSubscriptions } = useIAP();
function RenderProduct({ item } : { item: Subscription }) {
const iosSubscription: SubscriptionIOS = item as SubscriptionIOS;
return(
<View style={styles.productCard}>
<CustomText
customStyles={styles.productTitle}
text={iosSubscription.title}
size={"medium"}
/>
<CustomText
customStyles={styles.productDescription}
text={iosSubscription.description}
size={"small"}
/>
<CustomText
customStyles={styles.productPrice}
text={iosSubscription.localizedPrice}
size={"small"}
/>
<Button
title="Purchase"
disabled={isPurchasing}
onPress={
() => HandlePurchase(iosSubscription.productId)
}
/>
</View>
);
}
async function HandlePurchase(sku: Sku) {
try {
setIsPurchasing(true);
await requestSubscription({
sku,
andDangerouslyFinishTransactionAutomaticallyIOS: false
});
}
catch (error: any) {
Alert.alert("Error", "Failed to purchase: " + error.message);
}
finally {
setIsPurchasing(false);
}
}
useEffect(() => {
setLoading(true);
console.log(`[${new Date().toISOString()}] Initializing IAP connection...`);
const setupIAP = async () => {
try {
const result = await initConnection();
console.log(`[${new Date().toISOString()}] IAP connection initialized:`, result);
await clearTransactionIOS();
await getSubscriptions({
skus: subscriptionsProducts
});
}
catch (error: any) {
Alert.alert("Error", "Failed to load products: " + error.message);
}
finally {
setLoading(false);
}
};
setupIAP()
.finally(() => setLoading(false));
}, []);
useEffect(() => {
const checkCurrentPurchase = async () => {
try {
if(currentPurchase?.productId) {
console.log("Current purchase: ", currentPurchase);
console.log("Transaction Id: ", currentPurchase.transactionId);
await finishTransaction({
purchase: currentPurchase,
isConsumable: false,
});
}
}
catch (error) {
if(error instanceof PurchaseError) {
console.log("Purchase error: ", error);
}
else {
Alert.alert("Error", "Failed to finish transaction: " + error);
}
}
}
if(currentPurchase) {
console.log("Finishing current purchase.");
checkCurrentPurchase()
.catch(error => Alert.alert("Error", "Failed to finish transaction: " + error.message));
}
}, [currentPurchase, finishTransaction]);
return(
<View style={styles.mainContainer}>
<Heading
text={"Packages & Subscriptions"}
type={"h2"}
customStyles={styles.header}
/>
{
loading ?
<ActivityIndicator size="large" /> :
subscriptions.length > 0 ?
(
<>
<FlatList
data={subscriptions}
renderItem={RenderProduct}
keyExtractor={(item) => item.productId}
/>
</>
) :
(
<CustomText
customStyles={styles.productDescription}
text={"No available products."}
size={"small"}
/>
)
}
</View>
);
}
export default IAPScreen;
I am using a store kit file where I just edited the scheme of application to use that store kit file.
I would be really thankful If you can help me in this matter.
Sorry but I'm not good at English.
Is the originalTransactionId received for the same subscription by the same user the same in Store Kit v1 and Store Kit 2?
Also, will the originalTransactionId be the same even if the subscription price is changed?
Hello Developers!
I am trying to run a test In-App Purchase (IAP) for a renewable subscription product in the sandbox environment. I have set up everything required for sandbox testing, but it’s unclear whether the subscription product needs to be pre-approved by Apple for testing.
If approval is required, I have already added the necessary metadata, but the status still shows "Ready for Submit." Additionally, when I save the page, a "Submit for Review" button briefly appears for a fraction of a second on the subscription page before disappearing.
Is this button missing, or is there a known issue with this process? This is my first time running this test, and I would appreciate any pointers or suggestions. Thanks!
Hello,
I have a customer who keeps getting an "app is damaged" error for a freshly downloaded app from the Mac App Store.
The logs show the following lines:
standard 12:58:40.390872+0200 storeuid Receipt Validation (at.EternalStorms.Yoink)
Signature Check: PASS
Bundle ID Check: PASS
Bundle Version Check: PASS
GUID Check: PASS
Expiration Check: PASS
standard 12:58:40.391649+0200 storelegacy StoreLegacy: Failed to perform in-line receipt renewal for application at path /Applications/Yoink.app : '(null)'
The Mac in question is running macOS 12 Monterey - curiously, the customer has another Mac with that same system version and there it works just fine.
What can be done to make this work again?
Thank you,
– Matthias
Product.SubscriptionInfo.isEligibleForIntroOffer(for: "21340582")
In the production environment, I have already used the intro offer for this group, but this method still returns true
Hi everyone,
I'm encountering an issue with StoreKit 2 and subscriptions that I hope someone can help clarify.
Here's the scenario:
A user purchases a subscription.
The user cancels the subscription in their Apple ID settings (it remains active until the end of the billing period).
While the subscription is still active, the user reopens the app and tries to repurchase the same subscription.
The problem:
The purchase() method start well a new billing flow, but once confirmed throws a StoreKitError.unknown.
Despite this error, the subscription gets re-enabled and appears active again in the currentEntitlements.
So my question is why the purchase method throw an error and how to deal with this case ?
I precise I'm currently only working in sandbox, maybe the behavior is different in production (but even in that case there is still a bug in Sandbox that should not happen).
Also in that case the Apple Server Notification API send the webhook with type DID_CHANGE_RENEWAL_STATUS (and subtype AUTO_RENEW_ENABLED), which is expected.
Thanks for help,
Gregoire.
I cannot test IAP using sandbox account that I logged on from settings, it keeps show my regular Apple ID when I try to test IAP from TestFlight
This issue frustrate me and bunch of my colleagues, we cannot manage our subscription when sandbox account is default choosing Apple ID
I've seen people complaining about this issue a lot
Any help on resolving this issue would be really appreaciated
Hi, all!
I am wondering about something about App Receipts. I'm using App Receipt hash to key some information server-side. I'm curious however, if that doesn't actually have a possible flaw. Is it possible to get a new receipt that would yield a different hash for the same transaction? Reinstalling the app, perhaps? Installing the app on a new phone? Basically, I want to make sure this hash is something I can rely on. If the user can get a new hash for the same purchase, that's obviously problematic.
Thanks!
Hello,
I'm encountering an issue when trying to use the subscriptionGroupLookups endpoint in the App Store Connect API.
Despite having the correct setup, I continue to receive a 404 NOT FOUND error when making requests to:
GET https://api.appstoreconnect.apple.com/v1/subscriptionGroupLookups
Here is the current state of my environment:
I am the Account Holder of the App Store Connect account
The App Store Connect API key has been successfully created
I have the correct Key ID, Issuer ID, and .p8 private key
I can authenticate and access the apps and subscriptionGroups endpoints
However, the subscriptionGroupLookups endpoint always returns:
{
"errors": [
{
"status": "404",
"code": "NOT_FOUND",
"title": "The specified resource does not exist"
}
]
}
I suspect that LookUp Keys (UUIDs) have not been assigned to our subscription groups, even though they were created and are active in App Store Connect.
There is no “Request Access” button visible under the Integrations tab (as mentioned in Apple support instructions), and my keys appear under “App Store Connect API” > “Keys” as active.
Questions:
How can I ensure that LookUp Keys are assigned to my subscription groups?
Is there a way to trigger this manually or via support?
Has anyone successfully resolved this?
Any advice or experience would be greatly appreciated.
Thank you!
A user made an in-app purchase on December 15th at around 4:00 PM Japan Standard Time (JST). However, the confirmation email sent after the purchase shows the receipt date as December 14th.
What could be causing this discrepancy in the date?
The app store's primary language is set to English.
The server region is singapore.
Topic:
App & System Services
SubTopic:
StoreKit
Hi, all!
I have an AppStore Server-side question. User sends up an AppReceipt that I am validating. What's the best way to tell the receipt belongs to said user? I want to make sure that the source of the AppReceipt was actually the original purchaser of the item. Is fetching Transaction + AppAccountToken the only way? AppAccountToken can only be utilized if the original purchase used it, and it is associated with the user's data. Is there another way?
I have several ObjC based apps in the App Store and used to validate the receipt file inside the app in my code, and then reject it with exit(173) if it's invalid, which did trigger macOS to update the receipt if possible.
This isn't working any more in recent macOS versions, where the user is instead just told that the app is damaged, and they need to re-install it manually. Which sucks.
So I wanted to update my code. I read about SKReceiptRefreshRequest, which is supposed to re-download and install the receipt file, if I understand it correctly.
I implemented the code but now have trouble verifying that it works as intended, and does this in a user friendly way.
I found in my tests that macOS now caches the receipt in ~/Library/Caches/com.apple.appstoreagent/fsCachedData and then hardlinks the file into the app.
BTW: Sadly, this also requires that the app is located on the startup volume or the system will refuse to install the receipt, which wasn't a requirement in past times.
Now, if the receipt is already present in the cache folder, then my code works - the receipt gets re-linked.
But what if the cached receipt isn't there, yet? Such as that the user had copied the app from another Mac over to a freshly installed Mac? In the past, when the user then launched the app on the new Mac, he'd be prompted to login to the MAS and if that worked, the receipt would get installed and the app launched.
Basically, the question is: What if the receipt validation fails in my app and I request a new receipt, but the user has not yet logged into MAS (e.g. new computer)?
To simulate this, I logging out of the MAS and TestFlight, deleting all copies of the app and then run the app that I had copied from another Mac where it was authorized with a valid receipt for that device.
If I do this with the old version that uses exit(173), I get these two messages in macOS 15.2:
The second one is especially terrible because it shows the translocated path, which the average user surely get quite confused, and then maybe even search in vain for the app in there and get frustrated. But that's out of my hands. Sigh.
Now, that was proving that the old method with exit(173) isn't working any more and needs to be changed in my apps.
Since I'm still developing (testing) this new behavior, the app is therefore not in the MAS yet - the only way for me to test this is to use TestFlight. However, running a Testflight app copied from another Mac leads to this error:
That is not helpful in simulating what would happen if this app was released in the MAS. This won't let me find out what happens if my app is run on a Mac where the receipt fails and I ask it to load it via SKReceiptRefreshRequest and if the user is NOT yet logged into the MAS account for this purchased app of his/hers.
That leaves only one option: Release the app with untested code and hope for the best.
Contrary to this new behavior, the old method did let me test this easily because I would just use the special App Store tester account with the MAS app, i.e. the built MAS app would, when I launched it locally, request for a login and I'd provide my tester's account. But this isn't available any more, apparently.
What a mess.
Product.SubscriptionInfo.isEligibleForIntroOffer(for: "21340582")
In the production environment, I have already used the intro offer for this group, but this method still returns true.
I am currently using StoreKit2 to set up the in-app purchase subscription flow, and I have already configured the subscription products in App Connect. I created a StoreKit Configuration file in Xcode and used it in the scheme. However, after completing the purchase, the transaction.jsonRepresentation data returns a transactionId of 0. After checking the documentation, I found that I need to disable the StoreKit Configuration and enable Sandbox Testing. But after disabling the StoreKit Configuration, I can't retrieve the real product data using Product.products(for: productIds). I can confirm that the ProductId I provided is real and matches the data configured in App Connect. Could you please help me identify the issue? Thank you
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
Developer Tools
StoreKit Test
StoreKit
Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You may be connecting to a server masquerading as a "auth-sandbox.itunes.apple.com", which threatens the security of your confidential information. "
I am the Lead iOS Developer for The Incc, an upcoming social networking application. The platform offers subscriptions that grant users access to premium content, primarily digital magazines showcasing diverse cultures, alongside standard social media features and additional unique functionalities.
I am exploring two specific use cases for our subscription model.
Promo Codes with Split Payments:
We plan to collaborate with the our influencers (referred to as Mover Shakers) by providing them with promo codes for users to purchase subscriptions. For such purchases, we aim to implement a revenue split model, allocating 10% to the influencer and the remainder to us after Apple’s fees.
Gifting Subscriptions:
We also wish to enable users to gift subscriptions to others within the app.
I understand that the Apple Subscription Service does not natively support these features.
What other options do we have to achieve this that are also not against the Apple's guidelines.
Our app server has subscription feature and processes purchase life cycles based on App Store Server Notification v1.
Last year, when users purchased subscriptions during the following timeframe, we received "INITIAL_BUY" notifications with "unified_receipt.Latest_receipt_info.purchase_date" set to future date(approx. 1 hour after the actual purchase).
2024-11-03 08:00:00 - 2024-11-03 09:00:00 Etc/GMT (UTC)
For example, we received the following v1 notification at 2024-11-03 08:36:33 Etc/GMT.
"notification_type": "INITIAL_BUY"
"unified_receipt.latest_receipt_info[].purchase_date": "2024-11-03 09:36:02 Etc/GMT"
Our server grants subscription entitlement based on "purchase_date" so the users had to wait 1 hour before the subscription features became available.
The timeframe coincided with the end of daylight saving time in the U.S., so we assume that it affected the behavior, but our country doesn't adopt daylight saving time.
We have some questions regarding this behavior.
In countries without daylight saving time, how should we handle such notifications with future purchase date in order to properly grant subscription entitlement?
In App Store Server Notification v2, could purchase date be set to future date at the end of daylight saving time in the U.S., just as in v1 notifications?
JWSTransactionDecodedPayload.purchaseDate