I've been working on adding in-app purchases and was able to create and test in-app purchases using Store Kit (yay!). During testing, I exercised my app in a way which caused the app to crash mid purchase (so I guess the normal cycle of receiving paymentQueue:updatedTransactions and calling finishTransaction was interrupted).
我一直致力于增加应用内购买,并且能够使用Store Kit(耶!)创建和测试应用内购买。在测试过程中,我以一种导致应用程序在购买过程中崩溃的方式运行我的应用程序(因此我猜测,接收paymentQueue的正常循环是:updatedTransactions和调用finishTransaction被中断)。
Now I am unable to successfully complete any transactions and instead am getting only transactions with transactionState SKPaymentTransactionStateFailed when paymentQueue:updatedTransactions is called.
现在,我无法成功地完成任何事务,而是只能在调用paymentQueue:updatedTransactions时使用transactionState skpaymenttransactionstatef获得事务。
The transaction.error.code is -1003 and the transaction.error.localizedDescription is "Cannot connect to iTunes Store"!
transaction.error。代码是-1003和transaction.error。本地化描述是“无法连接到iTunes Store”!
I have tried removing all products from iTunesConnect, and rebuilt them using different identifiers but that did not help. I have also tried using the App Store app to really connect to the real App Store and download some apps so I do have connectivity. Finally, I have visited the Settings:Store app to make sure I am signed out of my normal app store account.
我尝试从iTunesConnect中删除所有产品,并使用不同的标识符重新构建它们,但这没有帮助。我也尝试过使用App Store App来连接真正的App Store下载一些应用,这样我就有了连接。最后,我访问了Settings:Store app,以确保我注册了正常的app Store账户。
20 个解决方案
#1
39
I had a similar situation and dumped the iPhone's network traffic to see what's going on. I found that the normal store was contacted instead of the sandbox. It helped to delete the app from the device, make clean and build/install it again. Apparently something with the development profile had gone wrong.
我也遇到过类似的情况,为了看看发生了什么,我放弃了iPhone的网络流量。我发现正常的商店是联系的而不是沙箱。它帮助从设备中删除应用程序,进行清理并重新构建/安装它。显然,开发概要出现了问题。
Update: To dump the network traffic of a non-jailbroken iPhone, just use Internet Sharing on your Mac and configure your iPhone to use your Mac's WiFi. Then tcpdump -n -i en1
on your Mac will do the trick.
更新:要转储非越狱iPhone的网络流量,只需在Mac上使用Internet共享,并将iPhone配置为使用Mac的WiFi。然后tcpdump -n -i en1on你的Mac上就可以了。
#2
24
If you're getting error 0 "Cannot connect to iTunes Store" (which I realize is not the error -1003 that OP asked about, but a web search for error 0 also leads here), this can be caused by two possible problems:
如果你得到了错误0“无法连接到iTunes Store”(我意识到这不是OP询问的错误-1003,但是搜索错误0也会导致这个错误),这可能是由两个可能的问题引起的:
- You're passing in the wrong product identifier. If that's the case, then you'll get error 0 shortly after calling
-[SKPaymentQueue addPayment:]
, before you get the popup asking you to confirm payment. - 您正在传递错误的产品标识符。如果是这种情况,那么在调用-[SKPaymentQueue addPayment:]之后,在弹出窗口要求您确认付款之前,您将得到错误0。
- Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.
- 您的测试用户已经失效。如果您不小心与测试用户登录了应用程序商店,就会发生这种情况。当发生这种情况时,您将在输入密码以确认您的付款后得到错误0。
To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.
要修复问题#1,请输入正确的产品ID。要修复问题#2,请在iTunes Connect上创建一个新的测试用户,并可选择删除旧的测试用户。
#3
14
I had a similar issue, was getting "Cannot connect to iTunes Store" with Code=0. This is how I solved it, after trying every other ritualistic piece of advice found on the Internet from re-downloading my certificates to resetting all my device settings to sacrificing a virgin black goat:
我有一个类似的问题,“无法连接到iTunes Store”,代码=0。这是我解决它的方法,在尝试了网上的每一项仪式后,重新下载我的证书,重新设置我所有的设备设置,以牺牲一个原始的黑山羊:
In the target summary for the app, I used to have my version number in the "build" field, but nothing in "version" field. This seemed odd to me, so I moved the version number from "build" to "version". This resulted in the aforementioned error. Moving the version number back to "build" solved the error.
在应用程序的目标摘要中,我曾经在“构建”字段中有我的版本号,但在“版本”字段中没有。这对我来说很奇怪,所以我将版本号从“构建”移到了“版本”。这导致了上述错误。将版本号移回“build”解决了这个错误。
#4
13
Add new test user for your app.
为应用程序添加新的测试用户。
#5
11
Make sure you have correct date and time set in the Settings. otherwise it fails to make a SSL conenction to the store!!
确保在设置中设置了正确的日期和时间。否则,它将无法对存储进行SSL保护!!
#6
6
I had the same error, and after reading through some threads on the developer forums, I reset the settings on my device (Settings->General->Reset->Reset All Settings), which cleared it up. It seemed drastic, but it worked.
我也有同样的错误,在浏览了开发者论坛上的一些线程之后,我重新设置了我的设备上的设置(设置->通用->复位->复位所有的设置),这就清除了它。这似乎太激烈了,但还是奏效了。
#7
2
I had the same error that seemed to pop up out of nowhere (was working fine one day, but then the next day it was giving me these errors about 2 out of every 3 times I tried testing my in-app purchase).
我犯了同样的错误,似乎是突然冒出来的(有一天我做得很好,但第二天我每3次测试我的应用内购买,就有2次出错)。
Then I visited the App Store (when trying to make another real purchase), and realized that they had a new user agreement that they wanted me to verify. After I did that, when I went back to my own app and tried out the test purchase again, it was working fine and have had no errors since. So I suspect I was getting the error because they wanted me to verify the new user agreement.
然后我访问了应用程序商店(当我试图进行另一次真正的购买时),并意识到他们有一个新的用户协议,他们希望我验证。在那之后,当我回到我自己的应用,再次尝试测试购买时,它运行得很好,并且从那以后没有出现错误。所以我怀疑我犯了错误,因为他们想让我验证新的用户协议。
Now the only thing I wonder is if there is a way for my in-app purchase to forward that prompt to my users instead of giving them a mysterious error?
现在,我唯一想知道的是,是否有一种方法可以让我的内购程序将这个提示转发给我的用户,而不是给他们一个神秘的错误?
#8
1
What worked for me was to uninstall my app from the test device, then install a fresh copy from Xcode.
对我起作用的是从测试设备上卸载我的应用程序,然后从Xcode中安装一个新的副本。
#9
1
In SKPaymentTransactionState
tells that SKPaymentTransactionStateFailed
before your request is added to server queue.
在SKPaymentTransactionState中,在将请求添加到服务器队列之前,告知skpaymenttransactionstatef。
@class SKPayment;
enum {
SKPaymentTransactionStatePurchasing, // Transaction is being added to the server queue.
SKPaymentTransactionStatePurchased, // Transaction is in queue, user has been charged. Client should complete the transaction.
SKPaymentTransactionStateFailed, // Transaction was cancelled or failed before being added to the server queue.
SKPaymentTransactionStateRestored // Transaction was restored from user's purchase history. Client should complete the transaction.
};
typedef NSInteger SKPaymentTransactionState;
And on SKPaymentTransaction
Class Reference Error Discussion says:
关于SKPaymentTransaction类引用错误讨论说:
The error property is undefined except when transactionState is set to SKPaymentTransactionStateFailed
. Your application can read the error property to determine why the transaction failed.
error属性未定义,除非将transactionState设置为skpaymenttransactionstat。应用程序可以读取error属性,以确定事务失败的原因。
So, transaction.error.localizedDescription is "Cannot connect to iTunes Store"! is a general error message.. I am also getting this error message regularly while testing my InApp Purchases.
所以,transaction.error。本地化描述是“无法连接到iTunes Store”!是一个普遍的错误信息。在测试我的InApp购买时,我也经常收到这个错误信息。
Some tips u can do is,
你能做的一些建议是,
-
Retrieve all products from app store using
SKProductsRequest
and check itsresponse.products
contain your requestedproductIdentifier
. for this use,使用SKProductsRequest从app store检索所有产品并检查其响应。产品包含您所要求的产品标识符。使用,
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:[objProducts allKeys]]]; //pass product identifier array as argument [request start];
And Catch response in :
以及捕捉响应:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
NSArray *myProduct = response.products;
}
So that you can decide is you can communicate to app store. and your product id is there.
所以你可以决定你可以和应用商店交流。你的产品id在那里。
- Make sure that you use In App test user account for testing.
- 确保您在应用程序测试用户帐户中使用测试。
- And you use the same app-id provisioning that you configured In App purchase.
- 你使用和你在App购买中配置的相同的App -id配置。
thanks
谢谢
#10
0
I fiddled around with going to the App Store and then back to Settings/Store to Sign Out. I did this 3 times, revisiting my app each time and adding debugging NSLog output, and now I am able to continue testing my in-app purchase code without error -1003. I am not sure the exact reason for this working again, but I am fairly certain is is not a code change on my part as all I was doing was adding NSLogs and re-running my app.
我在应用商店里闲逛,然后回到设置/商店去注册。我这样做了3次,每次都重新访问我的应用并添加调试NSLog输出,现在我可以继续测试我的应用内购买代码,没有错误-1003。我不确定再次运行这个程序的确切原因,但我相当肯定的是,这不是我的代码更改,因为我所做的只是添加NSLogs并重新运行我的应用程序。
#11
0
Yeah, IF you've connected your iPad/iPhone to a different computer initially, and are now using it on another, you absolutely must sign out of store on your iPad, sign in w/ normal account to ITunes on your MAC, then Sync.
是的,如果你一开始把你的iPad/iPhone连接到另一台电脑上,现在又在另一台电脑上使用它,你一定要在iPad上签字离开商店,在你的MAC电脑上登录w/ normal账户到ITunes,然后同步。
Also, make sure your iPad "WIFI" is on...
另外,确保你的iPad“WIFI”在…
#12
0
I Did a Clean all Targets in XCode and manually deleted the application off my device, then Build and Run from XCode and it fixed a similar problem (Same error message but different error code:-1009)
我在XCode中清除了所有目标,并手动删除了设备上的应用程序,然后从XCode构建并运行它,它修复了一个类似的问题(相同的错误消息但不同的错误代码:-1009)
#13
0
Unfortunately, I ran into a problem that was not documented here. In-App-Purches will not work until you accepted all contracts related to app- and in-app-purcheses. So make sure you (or your customer) set up all contracts in iTunesConnect properly, they must appear in the "Contracts In Effect" section to make your purchaes work.
不幸的是,我遇到了一个没有记录的问题。在您接受与应用程序和内购应用程序相关的所有合同之前,应用程序包不会工作。因此,确保您(或您的客户)在iTunesConnect中设置了所有的契约,它们必须出现在“契约生效”部分,以使您的purchaes正常工作。
#14
0
Our problem was that in Itunes Connect we had the wrong bundle identifier. Someone had created the app before hand and we had to edit the app and set its appId to the new one.
我们的问题是,在Itunes Connect中,我们有错误的bundle标识符。有人事先创建了这个应用,我们必须编辑这个应用,并将它的appId设置为新的。
#15
0
I had two problems that caused this:
我有两个问题导致了这个:
1) I had copied the IAP code from a different (working) app but had missed setting up my observer:
1)我从另一个(正在工作的)应用程序中复制了IAP代码,但是我错过了设置我的观察者:
observer = [[IAPHelper alloc] init]; [[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
观察者= [IAPHelper alloc] init;[[SKPaymentQueue defaultQueue]addTransactionObserver观察员):;
2) I was logged in to iTunes in the settings of my device. You can only use a test user in the sandbox - I logged out and it worked again.
2)我在设备设置中登录iTunes。您只能在沙箱中使用一个测试用户——我退出了,它又重新运行了。
#16
0
Just log out your iTunes account (don't login your test account now! ) , and start your program. When inapp purchase it ask your login details, you must enter your test account information.
只要注销你的iTunes账户(现在不要登录你的测试账户!)然后开始你的程序。当inapp购买它询问你的登录细节时,你必须输入你的测试账户信息。
#17
0
I tried every solution offered in the thread here, but to no avail. In my case, I had a wild-card bundle identifier starting with the same domain name as the one I used while creating the bundle identifier for in-app purchase provisioning profile.
我尝试了线程中提供的所有解决方案,但没有任何效果。在我的例子中,我有一个从与我在为应用内购买准备配置文件创建bundle标识符时使用的相同域名开始的外卡bundle标识符。
Here is how I fixed the problem and may help you fix yours (See attached):
以下是我解决问题的方法,可以帮助你解决你的问题(见附件):
1) Connect your iPhone to Mac.
1)把iPhone和Mac连接起来。
2) Under the "Devices" (in Xcode > Window menu > Organizer window) select the "Provisioning Profiles" option for your iPhone. You will see all provisioning profiles currently residing on your iPhone.
2)在“设备”(Xcode >窗口菜单>组织窗口)中选择iPhone的“配置配置文件”选项。您将看到目前驻留在您的iPhone上的所有配置文件。
3) Carefully remove all provisioning profiles starting with the particular domain name in the bundle identifier (com.MYDOMAIN.*) especially the ones that use wild-card except for the one you create specifically with the ability to do In-App purchase (com.MYDOMAIN.inappidentifier).
3)小心地删除所有配置文件,从bundle标识符(com.MYDOMAIN.*)中的特定域名开始,特别是那些使用wilcard的配置文件,除了您创建的具有应用内购买功能的配置文件(com.MYDOMAIN.inappidentifier)。
4) Install the app afresh and test your implementation with a fresh iTunes connect test user (sandbox)
4)重新安装app,使用新的iTunes connect测试用户(沙箱)测试你的实现
SCREENSHOT:
截图:
#18
0
I have been stuck for 2 days, here's my solution:
我被困了2天,我的解决办法是:
- Remove all in-app-products.
- 删除所有in-app-products。
- Remove new in-app-products.
- 删除新in-app-products。
- Create a sandbox tester.
- 创建一个沙箱测试仪。
- Log out my apple account from device (iPad), and then try to buy the product.
- 从设备(iPad)注销我的苹果账户,然后尝试购买产品。
- It will ask for login, then re-login with the sandbox tester account.
- 它将请求登录,然后使用sandbox tester帐户重新登录。
- Purchase goes through.
- 购买经历。
I think the importance is the sandbox tester account, I have not used it before since I always got error-0.
我认为重要的是sandbox测试器帐户,我以前没有使用过它,因为我总是有错误。
#19
0
In my case, I tried everything in the internet, but nothing worked.
就我而言,我尝试了互联网上的所有东西,但都没有成功。
Apple actually broke the production payment system, and the sandbox. I just had to wait two days, and it started to work.
苹果实际上打破了生产支付系统和沙箱。我只等了两天就开始工作了。
#20
0
The In-App Purchase FAQ says:
应用内购买FAQ说:
Cannot connect to iTunes Store
无法连接到iTunes Store
The "Cannot connect to iTunes Store" issue may be due to one or more of the following reasons:
“无法连接到iTunes Store”的问题可能有以下一个或多个原因:
- The sandbox may be unreachable.
- 沙箱可能无法到达。
- Your app does not have a bundle version (CFBundleVersion). See Setting the Version Number and Build String for more information.
- 您的应用程序没有捆绑版本(CFBundleVersion)。有关更多信息,请参见设置版本号和构建字符串。
- Your app is running in the Simulator, which does not support in-app purchase.
- 你的应用程序在模拟器中运行,不支持内购。
- You are attempting to purchase a product that is unavailable for sale. See Query the App Store for product information before presenting your app’s store UI for more information.
- 您正在尝试购买无法销售的产品。在显示App Store UI之前,请查看App Store查询产品信息。
In my case, the error occurred because I was using the Xcode simulator. It started working when I used my device.
在我的例子中,出现错误是因为我正在使用Xcode模拟器。当我使用我的设备时,它开始工作了。
Even in the In-App Purchase Programming Guide says to use the development iOS device has a suggested testing step.
甚至在《应用内购买编程指南》(in - app Purchase Programming Guide)中也说,使用iOS设备开发有一个建议的测试步骤。
#1
39
I had a similar situation and dumped the iPhone's network traffic to see what's going on. I found that the normal store was contacted instead of the sandbox. It helped to delete the app from the device, make clean and build/install it again. Apparently something with the development profile had gone wrong.
我也遇到过类似的情况,为了看看发生了什么,我放弃了iPhone的网络流量。我发现正常的商店是联系的而不是沙箱。它帮助从设备中删除应用程序,进行清理并重新构建/安装它。显然,开发概要出现了问题。
Update: To dump the network traffic of a non-jailbroken iPhone, just use Internet Sharing on your Mac and configure your iPhone to use your Mac's WiFi. Then tcpdump -n -i en1
on your Mac will do the trick.
更新:要转储非越狱iPhone的网络流量,只需在Mac上使用Internet共享,并将iPhone配置为使用Mac的WiFi。然后tcpdump -n -i en1on你的Mac上就可以了。
#2
24
If you're getting error 0 "Cannot connect to iTunes Store" (which I realize is not the error -1003 that OP asked about, but a web search for error 0 also leads here), this can be caused by two possible problems:
如果你得到了错误0“无法连接到iTunes Store”(我意识到这不是OP询问的错误-1003,但是搜索错误0也会导致这个错误),这可能是由两个可能的问题引起的:
- You're passing in the wrong product identifier. If that's the case, then you'll get error 0 shortly after calling
-[SKPaymentQueue addPayment:]
, before you get the popup asking you to confirm payment. - 您正在传递错误的产品标识符。如果是这种情况,那么在调用-[SKPaymentQueue addPayment:]之后,在弹出窗口要求您确认付款之前,您将得到错误0。
- Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.
- 您的测试用户已经失效。如果您不小心与测试用户登录了应用程序商店,就会发生这种情况。当发生这种情况时,您将在输入密码以确认您的付款后得到错误0。
To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.
要修复问题#1,请输入正确的产品ID。要修复问题#2,请在iTunes Connect上创建一个新的测试用户,并可选择删除旧的测试用户。
#3
14
I had a similar issue, was getting "Cannot connect to iTunes Store" with Code=0. This is how I solved it, after trying every other ritualistic piece of advice found on the Internet from re-downloading my certificates to resetting all my device settings to sacrificing a virgin black goat:
我有一个类似的问题,“无法连接到iTunes Store”,代码=0。这是我解决它的方法,在尝试了网上的每一项仪式后,重新下载我的证书,重新设置我所有的设备设置,以牺牲一个原始的黑山羊:
In the target summary for the app, I used to have my version number in the "build" field, but nothing in "version" field. This seemed odd to me, so I moved the version number from "build" to "version". This resulted in the aforementioned error. Moving the version number back to "build" solved the error.
在应用程序的目标摘要中,我曾经在“构建”字段中有我的版本号,但在“版本”字段中没有。这对我来说很奇怪,所以我将版本号从“构建”移到了“版本”。这导致了上述错误。将版本号移回“build”解决了这个错误。
#4
13
Add new test user for your app.
为应用程序添加新的测试用户。
#5
11
Make sure you have correct date and time set in the Settings. otherwise it fails to make a SSL conenction to the store!!
确保在设置中设置了正确的日期和时间。否则,它将无法对存储进行SSL保护!!
#6
6
I had the same error, and after reading through some threads on the developer forums, I reset the settings on my device (Settings->General->Reset->Reset All Settings), which cleared it up. It seemed drastic, but it worked.
我也有同样的错误,在浏览了开发者论坛上的一些线程之后,我重新设置了我的设备上的设置(设置->通用->复位->复位所有的设置),这就清除了它。这似乎太激烈了,但还是奏效了。
#7
2
I had the same error that seemed to pop up out of nowhere (was working fine one day, but then the next day it was giving me these errors about 2 out of every 3 times I tried testing my in-app purchase).
我犯了同样的错误,似乎是突然冒出来的(有一天我做得很好,但第二天我每3次测试我的应用内购买,就有2次出错)。
Then I visited the App Store (when trying to make another real purchase), and realized that they had a new user agreement that they wanted me to verify. After I did that, when I went back to my own app and tried out the test purchase again, it was working fine and have had no errors since. So I suspect I was getting the error because they wanted me to verify the new user agreement.
然后我访问了应用程序商店(当我试图进行另一次真正的购买时),并意识到他们有一个新的用户协议,他们希望我验证。在那之后,当我回到我自己的应用,再次尝试测试购买时,它运行得很好,并且从那以后没有出现错误。所以我怀疑我犯了错误,因为他们想让我验证新的用户协议。
Now the only thing I wonder is if there is a way for my in-app purchase to forward that prompt to my users instead of giving them a mysterious error?
现在,我唯一想知道的是,是否有一种方法可以让我的内购程序将这个提示转发给我的用户,而不是给他们一个神秘的错误?
#8
1
What worked for me was to uninstall my app from the test device, then install a fresh copy from Xcode.
对我起作用的是从测试设备上卸载我的应用程序,然后从Xcode中安装一个新的副本。
#9
1
In SKPaymentTransactionState
tells that SKPaymentTransactionStateFailed
before your request is added to server queue.
在SKPaymentTransactionState中,在将请求添加到服务器队列之前,告知skpaymenttransactionstatef。
@class SKPayment;
enum {
SKPaymentTransactionStatePurchasing, // Transaction is being added to the server queue.
SKPaymentTransactionStatePurchased, // Transaction is in queue, user has been charged. Client should complete the transaction.
SKPaymentTransactionStateFailed, // Transaction was cancelled or failed before being added to the server queue.
SKPaymentTransactionStateRestored // Transaction was restored from user's purchase history. Client should complete the transaction.
};
typedef NSInteger SKPaymentTransactionState;
And on SKPaymentTransaction
Class Reference Error Discussion says:
关于SKPaymentTransaction类引用错误讨论说:
The error property is undefined except when transactionState is set to SKPaymentTransactionStateFailed
. Your application can read the error property to determine why the transaction failed.
error属性未定义,除非将transactionState设置为skpaymenttransactionstat。应用程序可以读取error属性,以确定事务失败的原因。
So, transaction.error.localizedDescription is "Cannot connect to iTunes Store"! is a general error message.. I am also getting this error message regularly while testing my InApp Purchases.
所以,transaction.error。本地化描述是“无法连接到iTunes Store”!是一个普遍的错误信息。在测试我的InApp购买时,我也经常收到这个错误信息。
Some tips u can do is,
你能做的一些建议是,
-
Retrieve all products from app store using
SKProductsRequest
and check itsresponse.products
contain your requestedproductIdentifier
. for this use,使用SKProductsRequest从app store检索所有产品并检查其响应。产品包含您所要求的产品标识符。使用,
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:[objProducts allKeys]]]; //pass product identifier array as argument [request start];
And Catch response in :
以及捕捉响应:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
NSArray *myProduct = response.products;
}
So that you can decide is you can communicate to app store. and your product id is there.
所以你可以决定你可以和应用商店交流。你的产品id在那里。
- Make sure that you use In App test user account for testing.
- 确保您在应用程序测试用户帐户中使用测试。
- And you use the same app-id provisioning that you configured In App purchase.
- 你使用和你在App购买中配置的相同的App -id配置。
thanks
谢谢
#10
0
I fiddled around with going to the App Store and then back to Settings/Store to Sign Out. I did this 3 times, revisiting my app each time and adding debugging NSLog output, and now I am able to continue testing my in-app purchase code without error -1003. I am not sure the exact reason for this working again, but I am fairly certain is is not a code change on my part as all I was doing was adding NSLogs and re-running my app.
我在应用商店里闲逛,然后回到设置/商店去注册。我这样做了3次,每次都重新访问我的应用并添加调试NSLog输出,现在我可以继续测试我的应用内购买代码,没有错误-1003。我不确定再次运行这个程序的确切原因,但我相当肯定的是,这不是我的代码更改,因为我所做的只是添加NSLogs并重新运行我的应用程序。
#11
0
Yeah, IF you've connected your iPad/iPhone to a different computer initially, and are now using it on another, you absolutely must sign out of store on your iPad, sign in w/ normal account to ITunes on your MAC, then Sync.
是的,如果你一开始把你的iPad/iPhone连接到另一台电脑上,现在又在另一台电脑上使用它,你一定要在iPad上签字离开商店,在你的MAC电脑上登录w/ normal账户到ITunes,然后同步。
Also, make sure your iPad "WIFI" is on...
另外,确保你的iPad“WIFI”在…
#12
0
I Did a Clean all Targets in XCode and manually deleted the application off my device, then Build and Run from XCode and it fixed a similar problem (Same error message but different error code:-1009)
我在XCode中清除了所有目标,并手动删除了设备上的应用程序,然后从XCode构建并运行它,它修复了一个类似的问题(相同的错误消息但不同的错误代码:-1009)
#13
0
Unfortunately, I ran into a problem that was not documented here. In-App-Purches will not work until you accepted all contracts related to app- and in-app-purcheses. So make sure you (or your customer) set up all contracts in iTunesConnect properly, they must appear in the "Contracts In Effect" section to make your purchaes work.
不幸的是,我遇到了一个没有记录的问题。在您接受与应用程序和内购应用程序相关的所有合同之前,应用程序包不会工作。因此,确保您(或您的客户)在iTunesConnect中设置了所有的契约,它们必须出现在“契约生效”部分,以使您的purchaes正常工作。
#14
0
Our problem was that in Itunes Connect we had the wrong bundle identifier. Someone had created the app before hand and we had to edit the app and set its appId to the new one.
我们的问题是,在Itunes Connect中,我们有错误的bundle标识符。有人事先创建了这个应用,我们必须编辑这个应用,并将它的appId设置为新的。
#15
0
I had two problems that caused this:
我有两个问题导致了这个:
1) I had copied the IAP code from a different (working) app but had missed setting up my observer:
1)我从另一个(正在工作的)应用程序中复制了IAP代码,但是我错过了设置我的观察者:
observer = [[IAPHelper alloc] init]; [[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
观察者= [IAPHelper alloc] init;[[SKPaymentQueue defaultQueue]addTransactionObserver观察员):;
2) I was logged in to iTunes in the settings of my device. You can only use a test user in the sandbox - I logged out and it worked again.
2)我在设备设置中登录iTunes。您只能在沙箱中使用一个测试用户——我退出了,它又重新运行了。
#16
0
Just log out your iTunes account (don't login your test account now! ) , and start your program. When inapp purchase it ask your login details, you must enter your test account information.
只要注销你的iTunes账户(现在不要登录你的测试账户!)然后开始你的程序。当inapp购买它询问你的登录细节时,你必须输入你的测试账户信息。
#17
0
I tried every solution offered in the thread here, but to no avail. In my case, I had a wild-card bundle identifier starting with the same domain name as the one I used while creating the bundle identifier for in-app purchase provisioning profile.
我尝试了线程中提供的所有解决方案,但没有任何效果。在我的例子中,我有一个从与我在为应用内购买准备配置文件创建bundle标识符时使用的相同域名开始的外卡bundle标识符。
Here is how I fixed the problem and may help you fix yours (See attached):
以下是我解决问题的方法,可以帮助你解决你的问题(见附件):
1) Connect your iPhone to Mac.
1)把iPhone和Mac连接起来。
2) Under the "Devices" (in Xcode > Window menu > Organizer window) select the "Provisioning Profiles" option for your iPhone. You will see all provisioning profiles currently residing on your iPhone.
2)在“设备”(Xcode >窗口菜单>组织窗口)中选择iPhone的“配置配置文件”选项。您将看到目前驻留在您的iPhone上的所有配置文件。
3) Carefully remove all provisioning profiles starting with the particular domain name in the bundle identifier (com.MYDOMAIN.*) especially the ones that use wild-card except for the one you create specifically with the ability to do In-App purchase (com.MYDOMAIN.inappidentifier).
3)小心地删除所有配置文件,从bundle标识符(com.MYDOMAIN.*)中的特定域名开始,特别是那些使用wilcard的配置文件,除了您创建的具有应用内购买功能的配置文件(com.MYDOMAIN.inappidentifier)。
4) Install the app afresh and test your implementation with a fresh iTunes connect test user (sandbox)
4)重新安装app,使用新的iTunes connect测试用户(沙箱)测试你的实现
SCREENSHOT:
截图:
#18
0
I have been stuck for 2 days, here's my solution:
我被困了2天,我的解决办法是:
- Remove all in-app-products.
- 删除所有in-app-products。
- Remove new in-app-products.
- 删除新in-app-products。
- Create a sandbox tester.
- 创建一个沙箱测试仪。
- Log out my apple account from device (iPad), and then try to buy the product.
- 从设备(iPad)注销我的苹果账户,然后尝试购买产品。
- It will ask for login, then re-login with the sandbox tester account.
- 它将请求登录,然后使用sandbox tester帐户重新登录。
- Purchase goes through.
- 购买经历。
I think the importance is the sandbox tester account, I have not used it before since I always got error-0.
我认为重要的是sandbox测试器帐户,我以前没有使用过它,因为我总是有错误。
#19
0
In my case, I tried everything in the internet, but nothing worked.
就我而言,我尝试了互联网上的所有东西,但都没有成功。
Apple actually broke the production payment system, and the sandbox. I just had to wait two days, and it started to work.
苹果实际上打破了生产支付系统和沙箱。我只等了两天就开始工作了。
#20
0
The In-App Purchase FAQ says:
应用内购买FAQ说:
Cannot connect to iTunes Store
无法连接到iTunes Store
The "Cannot connect to iTunes Store" issue may be due to one or more of the following reasons:
“无法连接到iTunes Store”的问题可能有以下一个或多个原因:
- The sandbox may be unreachable.
- 沙箱可能无法到达。
- Your app does not have a bundle version (CFBundleVersion). See Setting the Version Number and Build String for more information.
- 您的应用程序没有捆绑版本(CFBundleVersion)。有关更多信息,请参见设置版本号和构建字符串。
- Your app is running in the Simulator, which does not support in-app purchase.
- 你的应用程序在模拟器中运行,不支持内购。
- You are attempting to purchase a product that is unavailable for sale. See Query the App Store for product information before presenting your app’s store UI for more information.
- 您正在尝试购买无法销售的产品。在显示App Store UI之前,请查看App Store查询产品信息。
In my case, the error occurred because I was using the Xcode simulator. It started working when I used my device.
在我的例子中,出现错误是因为我正在使用Xcode模拟器。当我使用我的设备时,它开始工作了。
Even in the In-App Purchase Programming Guide says to use the development iOS device has a suggested testing step.
甚至在《应用内购买编程指南》(in - app Purchase Programming Guide)中也说,使用iOS设备开发有一个建议的测试步骤。