应用程序内购买问题 - 我哪里出错了? iPhone

发布于 2024-10-27 23:01:17 字数 878 浏览 0 评论 0原文

我正在尝试测试我的应用内购买(在沙箱中)并遇到以下问题:

  • 应用程序成功检索可用产品并将其显示在表格中。
  • 用户单击“购买”
  • 要求用户输入用户名和密码(这是我的测试用户)。
  • 屏幕上返回一条确认信息,表明交易成功。

问题是内容没有被下载,并且似乎没有调用以下方法:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
            default:
                break;
        }
    }
}

任何人都可以帮忙吗?

I am trying to test my in app purchase (in sandbox) and have the following problem :

  • The app retrieves the available products successfully and displays them in a table.
  • The user clicks on "Buy"
  • The user is asked to enter user name and password (this is my test user).
  • A confirmation comes back saying on screen that the transcation was succesful.

The problem is that the content is then not downloaded and that the following method doesn't seem to be called :

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
            default:
                break;
        }
    }
}

Can anyone help ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪眸﹌ 2024-11-03 23:01:17

检查是否添加了事务观察器

[[SKPaymentQueue defaultQueue]addTransactionObserver:mObserverObject];

其中mObserverObject是您实现updatedTransactions方法的类的对象。

Check whether you added transaction observer

[[SKPaymentQueue defaultQueue]addTransactionObserver:mObserverObject];

Where mObserverObject is the object of class where you have implemented updatedTransactions method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文