简体   繁体   English

iPhone无法正确完成应用内交易(IOS7)

[英]iPhone not completing in-app transaction properly (IOS7)

I hope someone can help here, I have two iPhone apps out in the store with in-app purchases. 我希望有人能在这里为您提供帮助,我在商店中有两款iPhone应用程序可以进行应用程序内购买。 Both apps are mature code (been released for over 2 years) and both talk to the same web service and have been working fine for 2 years. 这两个应用程序都是成熟的代码(已发布2年以上),并且都与同一个Web服务通信,并且可以正常工作2年。

Now, we are getting a problem where some users (1 in 100, which is high for us) are completing the purchas and the devices just arent calling back to our web service after a successful transaction. 现在,我们遇到了一个问题,即一些用户(100个用户中有1个对我们来说很高)正在完成购买,而设备在成功交易后就无法回呼我们的Web服务。

The process flow we have is 我们拥有的流程是

User Starts Transaction and requests payment for an item 用户开始交易并要求付款

User Enters their details for iTunes and the purchase succeeds (we see a valid payment in their iTunes account) 用户输入其iTunes的详细信息,购买成功(我们在其iTunes帐户中看到有效的付款)

The App "should" then send the payment receipt to our web server to be validated and the app given permission to download the content 然后,该应用程序“应该”将付款收据发送到我们的Web服务器以进行验证,并授予该应用程序下载内容的权限

This process has been working fine for anything < IOS7 but for a few users since IOS7 we are not getting the call to our web server. 对于所有<IOS7而言,此过程都可以正常工作,但是对于自IOS7以来的一些用户,我们没有接到Web服务器的电话。

I am handling the transactionState of the SKPaymentTransaction correctly as it has been working for a long time, but as far as I can tell this method just isn't being hit sometimes? 我已经处理了很长时间,因此我正在正确处理SKPaymentTransaction的transactionState,但是据我所知,有时这种方法只是没有被使用?

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

Thank You. 谢谢。

I've experienced a similar issue with mature code. 对于成熟的代码,我也遇到过类似的问题。 It appears that the app store is sending null productIdentifiers to the SKPaymentTransactionObserver under certain circumstances. 在某些情况下,应用商店似乎向SKPaymentTransactionObserver发送了空productIdentifiers。

Unfortunately I couldn't reproduce in sandbox but I was able to with the App Store build. 不幸的是,我无法在沙箱中进行复制,但是我能够使用App Store构建。

  • I removed my credit card from my Apple ID 我从我的Apple ID中删除了信用卡
  • Then tried to purchase in-app purchase 然后尝试购买应用内购买
  • Added my card info back in when prompted 出现提示时重新添加我的卡信息
  • Went back to app 回到应用程式

The app crashes on any subsequent launches as well because store kit tries to process the transaction on launch (with the null ID). 该应用程序也会在以后的任何启动中崩溃,因为存储套件会尝试在启动时处理交易(具有空ID)。 It's easy enough to defensively code against the null product identifier but unfortunately it is going to require an update. 可以很容易地针对空产品标识符进行防御性编码,但不幸的是,这将需要更新。

This Stack Overflow thread was helpful. 该堆栈溢出线程很有帮助。

Sorry this doesn't answer your question but hopefully you find the info useful. 抱歉,这不能解决您的问题,但希望您觉得该信息有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM