paymentWithProductIdentifier

paymentWithProductIdentifier

本文介绍了paymentWithProductIdentifier的替代解决方案是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我在我的项目中使用APP购买。当我运行这个项目一切正常,除了我收到一条警告消息说paymentWithProductIdentifier已被弃用,我经历了堆栈溢出中提出的类似问题,但我不满意。我向您展示了我在下面的项目中使用的编码

Hi i am using in APP purchase in my project . When i run this project everything works fine, except i am getting a warning message saying that "paymentWithProductIdentifier is deprecated", I gone through the similar questions that are asked in stack overflow but i didn't satisfied. I shown you my coding that i used in the project below

SKPayment *payment=[SKPayment paymentWithProductIdentifier:@"com.mycompany.dmaker.maker1"];
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] addPayment:payment];

任何人都可以告诉我
1)此警告的替代方案。
2)或告诉我,如果我使用现有代码,该项目是否在appstore中批准。

Can anyone tell me 1)the alternative for this warning.2)or tell me whether this project approve in appstore if i use this existing code.

推荐答案

尝试使用此:

SKProduct *selectedProduct = <#from the products response list#>;
SKPayment *payment = [SKPayment paymentWithProduct:selectedProduct];
[[SKPaymentQueue defaultQueue] addPayment:payment];

这篇关于paymentWithProductIdentifier的替代解决方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-05 15:34