Ios in app purchase error

При оплате в iTunes и App Store появляется надпись «Your purchase could not be completed»? У данной ошибки есть несколько причин - все решения здесь!

Your purchase could not be completed в iOS

Всем привет! Сегодня хочется разобрать с вами одну очень необычную ошибку. В чем заключается ее странность? В том, что из-за этой проблемы мы с вами не можем потратить деньги в магазинах App Store и iTunes Store. Свои личные, честным трудом заработанные деньги. Отдать компании и разработчику. Нельзя.

Тим Кук, у вас там все нормально?:)

Все происходит приблизительно так: у нас есть желание купить игру, приложение или внутриигровую валюту — жмем оплатить — получаем «Your purchase could not be completed». Что это значит? Дословный перевод ошибки — «Ваша покупка не может быть завершена». Согласитесь, понятней пока не стало. Это нормально. Это Apple. По-другому и не бывает:)

Итак, у нас ничего не скачивается и не загружается. При этом, нам настойчиво предлагают обратиться в техническую поддержку вот такой вот фразой: «For assistance, contact iTunes support at www.apple.com/support/itunes/ww/.»

Ошибка "Your purchase could not..."

Впрочем, техподдержка может и подождать, а мы пока перейдем к причинам данной проблемы:

  1. На карте, привязанной к Apple ID, нет денег.
  2. У карты закончился срок действия.
  3. Вы, в процессе использования аккаунта, нарушили пользовательское соглашение iTunes.
  4. У Apple есть какие-то вопросы относительно вашей учетной записи Apple ID.

Что делать в первых двух случаях ясно — закинуть денег, проверить данные карты и при необходимости обновить их. А как быть с двумя оставшимся? Что это за нарушения и какие вопросы? Давайте об этом чуть подробней…

Итак, к ошибке «Your purchase could not be completed» в iTunes и App Store может привести нарушение пользовательского соглашения компании Apple.

Интересно, хотя бы один человек прочитал его его полностью?

Текст там действительно немаленький и придраться можно к многому, но наиболее распространенная причина — использование магазинов iTunes и Gift-карт других стран, отличных от страны вашего проживания.

Сейчас чуть подробней:

Итак, у вас есть Apple ID созданный на территории России и с Российским App Store. В один прекрасный момент, вы на этой учетной записи начинаете менять магазины (например на американский) и пользоваться Gift-картами из Америки. Потом еще раз изменили магазин на какой-нибудь другой страны и т.д. При этом вы по по-прежнему территориально находитесь в РФ.

Так вот, дорогие друзья, по правилам этого делать нельзя. Находитесь в России? Используйте российский App Store. Переехали в Китай? Обязательно смените страну и используйте китайские сервисы. Иначе — «Your purchase could not be completed» и здравствуйте заморочки с восстановлением Apple ID.

Выдержка из правил использования iTunes

Вы скажите: «Да у меня все знакомые так делают и все отлично, чего автор нагнетает?». Я отвечу: «У меня многие друзья поступают аналогично и пока все хорошо». Учетных записей много, и логично предположить что Apple не может проверить всех и вся. Просто если вы занимались подобным и столкнулись с «Your purchase could…», то это первое на что нужно обратить внимание.

Как поступить? Также как и в том случае, когда вы абсолютно не подозреваете за что прилетела подобная ошибка — связаться с технической поддержкой компании Apple и решить с ними все вопросы по использованию аккаунта.

Быть может данная проблема — это просто технический сбой (на американских форумах можно прочитать массу подобных примеров) и все можно исправить за несколько минут. Или им потребовалась какая-то дополнительная информация. Или… В общем, проще позвонить (написать) и спросить. Тем более, поддержка у Apple одна из лучших — в большинстве случаев все вопросы решаются в пользу клиента.

P.S. После прочтения статьи стало чуть понятней? Буду благодарен за «лайк» или нажатие на кнопки социальных сетей. Спасибо:)

P.S.S. Если вы столкнулись с подобной проблемой — потратьте пару минут, опишите ситуацию в комментариях. Спасибо еще раз:)

Дорогие друзья! Минутка полезной информации:

1. Вступайте в группу ВК — возможно, именно там вы сможете получить всю необходимую вам помощь!
2. Иногда я занимаюсь ерундой (запускаю стрим) — играю в игрушки в прямом эфире. Приходите, буду рад общению!
3. Вы всегда можете кинуть деньги в монитор (поддержать автора). Респект таким людям!
P.S. Моя самая искренняя благодарность (карта *9644, *4550, *0524, *9328, *1619, *6732, *6299, *4889, *1072, *9808, *7501, *6056, *7251, *4949, *6339, *6715, *4037, *2227, *8877, *7872, *5193, *0061, *7354, *6622, *9273, *5012, *1962, *1687 + перевод *8953, *2735, *2760 + без реквизитов (24.10.2021 в 18.34; 10.12.2021 в 00.31)) — очень приятно!

Have you ever tried to make a purchase on your iPhone or iPad for a new app or in-app purchase and received an error message that your purchase could not be completed in the App Store app?

More specifically, the error reads, “Your purchase could not be completed. For assistance, contact iTunes Support at www.apple.dom/support/itunes/ww/.” The message shows you a website to visit but no further help regarding why the purchase didn’t go through.

Here we’ll list some possible reasons why your purchase could not be completed and how to remedy the situation.

Purchase Could Not Be Completed error in iPhone App Store

The item is not available in your country

One of the most common reasons you can’t make a purchase is that the app or item is not available in your country.

Normally you’ll receive an error message stating this; however, that’s not guaranteed. So head to the App Store online, the developer’s website, or do a bit of research to see if the item can be purchased in the country in which you reside. You might even find a different version of the app available to you.

Your Apple ID is disabled or locked

For your protection, if your password or other account information is entered several times incorrectly, Apple automatically locks your Apple ID. Obviously, this is to protect you from unauthorized users accessing and using your account.

With two-factor authentication, use a “trusted” device or phone number to reset the password for your Apple ID. If you don’t have a trusted device or number and have security questions set up for your Apple ID, head to the forgot password page and follow the prompts.

If you can’t do either, you can go straight to Apple Support to help sort out this problem.

Your payment method cannot be charged

You may have a credit card on file that was declined, needs to be updated because of the expiration date, or has the wrong billing information. You should see a message that explains the problem with your payment method.

Luckily, you can easily manage your payment methods on almost any device. For Apple devices like iPhone, iPad, and Mac, visit this page to change, add, or remove an Apple ID payment method. For non-Apple devices like Android, PC, or Chromebook, visit this page to change an Apple ID payment method without an Apple device.

Then, review your payment methods and information, make any necessary changes, and try your purchase again. You might also consider adding another payment method to your account if you have only one. Check out this article on how App Store and iTunes purchases are billed.

Your Apple ID is linked to too many payment methods

On the other side of having only one payment method attached to your Apple ID is having too many. Apple finds this to be suspicious activity, and it may result in your Apple ID being locked.

You’ll find that this is a somewhat common issue that has been brought up many times in the Apple Community Forum. The answer is usually to contact Apple Support. So if you receive a message that you have too many credit cards attached to your Apple ID or believe you might, contacting Apple Support is the best way to fix this problem.

Screen Time settings are preventing the purchase

If you use Screen Time for yourself or a child who shares your device, you may have restricted purchases within those settings. To check this quickly, follow these steps:

  1. Open Settings and select Screen Time.
  2. Choose Content & Privacy Restrictions.
  3. If this setting is enabled, tap iTunes & App Store Purchases.
  4. If In-app Purchases is set to Don’t Allow, tap and change it to Allow.

Note: If you have a Screen Time passcode set up, you’ll be asked to enter it as you go through the above steps.

One other spot to check is in the same area, Content & Privacy Restrictions. Tap Allowed Apps and make sure that the iTunes Store (and Book Store, if necessary) is enabled.

Screen Time Content Restrictions Purchases and iTunes

For more help using Screen Time, check out the following how-tos:

  • How to restrict or only allow certain websites on Mac with Screen Time
  • How to use Screen Time Communication Limits on iOS
  • How to limit kids’ screen time on iPhone and iPad

Other things you can try

If you’re still being told that “Your Purchase Could Not Be Completed,” and none of the above seems to be the reason for your inability, here are other things you can try.

  • Make sure you’re using the correct Apple ID: Did you create an Apple ID without a credit card? If so, you might be using the wrong one to make your purchase.
  • Sign out of your Apple ID and back in again: Sometimes, just logging out and back in can fix the simplest of problems.
  • Restart your device: Your device may be having a momentary glitch, so restarting it could fix the issue.

When all else fails, contact Apple Support.

  1. Head to the Get Support page.
  2. Select Billing & Subscriptions.
  3. Click Subscriptions & Purchases.
  4. Choose Unable to purchase.

Then decide how you’d like help; chat, phone call now, or schedule a call.

Get Help Apple Support Options

It’s never fun when you try to buy an app, purchase a subscription, or make an in-app purchase and aren’t allowed. Hopefully, one of the above reasons and fixes solves your problem. If not, and you found a different one for why your purchase could not be completed in the App Store, please share in the comments below!

Related tips:

  • What is Apple ID balance and how to use it on iPhone, iPad, and Mac
  • How to download apps on iPhone without Apple ID password, Face ID, or Touch ID authentication
  • How to view your download history in the App Store

While browsing for In App Purchase tutorials, I found these two very useful blogs:

  1. In App Purchases: A Full Walkthrough

  2. Introduction to In-App Purchases in iOS 6 Tutorial

If you are a beginner you would find the first blog very useful. There is already existing library for in app purchase . Ronan O’Ciosoig has suggested to use RMStore for ease and I found that RMStore  is helpful for quick implementation of in app purchase.

However, after going through both the blogs, I did not find any answer on what to do when In App Purchase does not work. I took some points from here and there, figured out some ways on my own and finally solved the problem.

In this blog, I would talk about the possible issues that may hamper in app purchase process and would also talk about possible solutions.

1. The functionality runs on Device not on Simulator:

In App Purchase does not work in simulator for some specific reasons, it not even fetches the product details or product list from server. So, before running the app , please check the target device setting in your IDE and make sure it points to Device.

2. Product ID invalid :

The product ID of a certain product may show invalid for the following reasons  (courtesy: itsme.manish and abgtan from the forums):

  • Go to SettingsiTunes & App Stores, log out of any account, and try again so you’re sure you’re using a Sandbox account.

  • Check this link – if it doesn’t respond, the iTunes sandbox may be down.

  • Have you enabled In-App Purchases for your App ID?

  • Does your project’s .plist Bundle ID match your App ID?

  • Are you using the full product ID when when making an SKProductRequest?

  • Have you waited several hours since adding your product to iTunes Connect?

  • Are your bank details active on iTunes Connect?

  • Have you tried deleting the app from your device and reinstalling?

N. B. – Right convention for product naming is to put the full bundle Id followed by a “.” before the product name. For example, assume your project bundle identifier is “com.innofied.SampleProject”, then the product name should be “com.innofied.SampleProject.ProductName”.  Copy the product Id showed on apple website, and paste it in appropriate place of your project. Most of the people get Invalid product due to this specific reason.

3.  Restore Product Purchased:

In case non-consumable product, Apple strictly mentions to keep a restore button.

[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

You should add transaction observer at init method . You should do it in “buyProduct:” or “restoreTransactions:” method.  It is the best practice.

4. Remove Transaction observer on observer method calling:

Whenever you add an transactionObserver , it is your duty to remove it. If you don’t, it will create some issues like apple account login screen may appear without any reason. Several developers come across this specific problem. So, you should remove transaction observer on observer method call. like following :

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
   ...

   [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];

   ...
}

#pragma mark completed Transactions call back
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
   ...

   [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];

   ...
}
- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error{
   ...

   [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];

   ...
}
- (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions{
   ...

   [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];

   ...
}

5. Use new provisioning profile :

Sometimes people run their app with the existing ‘wildchar’  identifier in provisioning profile but it does not support In App Purchase. To test in app purchase you should create a new provisioning profile dedicated to the specific app and add it to the app.

Hope this helps. If you ever come up with any other issues while implementing In App Purchase features, feel free to comment here and we will help you find a realistic solution.

Replies

This doesn’t quite answer your question, as asked, but consider this…

What is new is you generate an error message and don’t display anything in the UI if you do not get back to the main queue here:

-(void) productsRequest: (SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)re
        
    dispatch_async(dispatch_get_main_queue(), ^{


//     code here that might include presenting a UIAlertController


    });
}

I don’t really understand what you mean? I don’t create any UIController myself, and I don’t see any error msg anywhere.

Is this in the sandbox running on a device connected to Xcode or is it using TestFlight or is it using a production app?

Are you getting a call back to updatedTransactions showing a state of ‘purchasing’?

This is happening in production (Grand Mountain Adventure is the name of the app).

You might be onto something, it seems the state of the transaction is Failed, SKErrorDomain Code=2 (Cannot connect to iTunes Store), which prevents the dialog from opening.

Info about the issue:

The last couple of days we’ve gotten compliants from users that they cannot purchase the in-app purchase, all of them have iOS 13.4.

When I upgraded my device to iOS 13.4 the same thing happened to me.

>the state of the transaction is Failed, SKErrorDomain Code=2 (Cannot connect to iTunes Store), which prevents the dialog from opening.

StoreKit will issue a ‘failed’ transaction to updatedTransactions if the user needs to refresh their credit card information. If the user refreshes their credit card information and then choses to proceed with the purchase then StoreKit issues two transactions in rapid succession — a failed and then a purchased. An app needs to hande that first ‘failed’ transaction silenetly and await the possibility of that second transaction. If your app drops its transaction observer after the ‘failed’ then the next transaction will await adding a transaction observer which might take place if the user tries to restoreCompletedTransactions.

But again, the only ‘new’ thing I am aware of is that need to get back on the main queue after a product request.

I assume you meant «In App Purchase» not «app». Otherwise this is an App Store problem.

> The last couple of days we’ve gotten compliants from users that they cannot purchase the app, all of them have iOS 13.4.

Thanks for taking the time.

You are correct, I mean the in-app purchase (updated).

Just for clarification, I haven’t uploaded ny new app version, in-app purchases just seems to have stopped working for users of iOS 13.4, it seems Flutter actually has the same issue: https://github.com/flutter/flutter/issues/53534

Regarding the queue, I never kill or stop the transaction observer, nor do I block on the main thread. The method updatedTransactions get’s executed everytime the user tries to buy (as the dialog is not shown, users usually press several times).

Or do you mean I have to manually restart the transaction observer?

Best/Viktor

First, ensure you’re finishing transactions upon success/failure:

In our case, the old code was not calling `SKPaymentQueue.default().finishTransaction(transaction)` to remove it from the queue. Prior to iOS 13.4, that apparently worked fine even though the documentation says it’s required

So what would happen is the dialog would show once and the person would cancel and then from that point on the transaction would persist in the queue and automatically return as cancelled without showing the dialog again. Finishing the transaction purges it and allows the dialog to show again

If that doesn’t work:

Per an Apple engineer’s request, I filed a radar for this (FB7648374) with App Store logging and sysdiagnose

Please do the same:

— Follow the instructions for App Store logging at https://developer.apple.com/bug-reporting/profiles-and-logs/

— Install the profile on your device that enables verbose logging

— Then repro the problem on your device w/ device logs running (Xcode -> Devices -> Console logs)

— Then immediately capture a sysdiagnose

— File a new radar with that information at https://feedbackassistant.apple.com/

In my case:

On the iOS 13.4 version of the device for multiple downgrades of in-applied products or canceling the purchased product before buying again, the confirmation payment dialog box will not pop up.

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactions

The transaction status returned by the method is directly SKPaymentTransactionStatePurchased. However, this order was not included in the order collection returned when verifying the receipt with the App Store.

However, the results of the above operations on the iPhone before iOS 13.4 version are all normal.

BTW, have you solved this problem?

That thing about credit card is not true at 100% since also with sandbox users has the same behavior.

Looks like an Apple problem.

But doesn’t that test whether you handle a failed transaction correctly! Maybe it is a feature not a bug.

I’m facing the same issue. Any updates on this?

Did you find right solution ?

Понравилась статья? Поделить с друзьями:
  • Ionic zip badcrcexception crc error the file being extracted appears to be corrupted
  • Iodd 2541 ошибка partition
  • Ioctl tiocmset protocol error
  • Io socket ssl pm 1177 global error undefined ssl object
  • Io netty channel abstractchannel error fix