Subscription Offer error

I'm testing the new Subscription Offers feature in iOS 12.2:

https://developer.apple.com/app-store/subscriptions/#subscription-offers


I have set up a Subscription Offer in App Store Connect, and the SKProduct property `discounts` contains this offer.


I am generating a signature from the server according to:

https://developer.apple.com/documentation/storekit/in-app_purchase/generating_a_signature_for_subscription_offers


I have a test account which has purchased the original SKProduct, in order to be eligible for the offer.


I'm also setting up a SKPayment with a SKPaymentDiscount correctly initialised with the signature return values.


However, when attempting to purchase the offer the transaction fails with the following error:


Error Domain=SKErrorDomain Code=12 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}


Also, in the Console I can see an error for the process `itunesstored`:


StoreKitClient: Buy failed with error: Error Domain=SSServerErrorDomain Code=3903 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store} for payment:  (entity: MicroPayment; id: 0xab06487fa50b06c0  ; data: )


Does anyone know if this indicates an issue with the paramters on the client side, or is there an issue with this feature within StoreKit as this is in beta?

Replies

The 'cannont connect to itunes store' is a standard error message that could mean many things.

Can your code and app setup (same device, contracts, bundleID, code signatures) handle a standard IAP?

>Does anyone know if


Recommend you file bugs against the beta (check the release notes first), then confirm your process via TN2413 IAP FAQ.


Be sure to add your report # to your thread for ref., thanks and good luck.

Yes, non-offer purchases seem fine.

The error code is 12, which as per SKError indicates an error with the signature.

I have found the issue.


The value for applicationUsername was too long, once a shorter value was used, it worked fine.

Good info, thanks for the followup and good luck in the store.

Hi, we are having the same issue too. Do you mind sharing your signing solution?

Hi we are having same issue to. Can you share your steps to generate signature?

Hi, there's our 2Coders fundings:


We've been facing the same issue for a week until we realise that even when the doc says "An optional string value that you define; may be an empty string. The app can provide this value and uses it in

applicationUsername
.", the validation result for the signature fails on the Store side.

Quick Conclusion: What we're doing now is sending a value from the app side.


const payload = appBundleID + '\u2063' +
  keyID + '\u2063' +
  productIdentifier + '\u2063' +
  subscriptionOfferID + '\u2063' +
  applicationUsername + '\u2063'+
  nonce + '\u2063' +
  timestamp;


If you consider sending "applicationUsername" var as an empty string or as a null value it will add a double \u2063 (invisible separator). Which in our findings produce a signature that won't mathes with the expected result on the Apple Stores side. Could be because then they separate the values based on this invisible separator.
Ofc. the doc says the lengh max (

UINT32_MAX)

Relevant docs:
Application username doc:
https://developer.apple.com/documentation/storekit/skmutablepayment/1506088-applicationusername


Generating signatures

https://developer.apple.com/documentation/storekit/in-app_purchase/subscriptions_and_offers/generating_a_signature_for_subscription_offers

  • Have anyone from here found a solution to this? I'm also getting the same error, along with the error code=3903

Add a Comment
I got the error Code=3903 when I request with the discount that was already used.
Got the same error as sekitaka, it's kinda strange because there weren't any such problems earlier, maybe just an apple bug

Did anyone solve what was going wrong with the errors:

  • Transaction error Error Domain=SKError Domain Code=12 "(null)"
  • ASDServerErrorDomain Code=3903 "Unable to Purchase"

Still unsure where things are going wrong... thank you in advance