简体   繁体   English

使用parse.com SDK进行应用内购买

[英]In app purchase using parse.com SDK

I am utilizing the parse.com sdk for a number of things in my app, so I thought I would also piggyback on it for my in app purchase. 我正在使用parse.com SDK来处理我的应用程序中的许多事情,因此我想我也应该在应用程序内购买时使用它。 I have an alert view with an "Upgrade" button that calls the following block. 我有一个带有“升级”按钮的警报视图,该按钮调用以下块。 I have verified that the block is being called but I am not able to get to the completion block. 我已经验证了正在调用该块,但是无法到达完成块。 Has anyone else encountered this? 有人遇到过这种情况么?

if ([buttonTitle isEqualToString:@"Upgrade"])
{
    [PFPurchase buyProduct:@"com.mysite.myapp.fullversionupgrade" block:^(NSError *error) {
        if (!error) {
            UIAlertView *succesfulUpgradeAlert = [[UIAlertView alloc]initWithTitle:@"Upgrade Complete" message:@"Thank you for upgrading." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
            [succesfulUpgradeAlert show];
        }
    }];
}

I should also point out that this app is not yet up and running on the app store, and I just added the in app purchase information today. 我还应该指出,此应用尚未在应用商店上启动并运行,我今天刚刚添加了应用内购买信息。 Does that make a difference? 这有什么区别吗? I understand those can be factors, but my alert view is simply being dismissed and, again, I'm not even getting to the completion block. 我知道这些因素可能会造成影响,但是我的警报视图只是被驳回了,再次,我什至没有进入完成阶段。

I don't quite understand your question: 我不太了解您的问题:

my alert view is simply being dismissed and, again, I'm not even getting to the completion block. 我的警报视图只是被驳回,再次,我什至没有到达完成块。

Does that mean you are getting an alert? 这是否意味着您正在收到警报? If that is the case, doesn't that mean that your completion block is being called? 如果是这种情况,这是否意味着正在调用您的完成程序块?

I am using the same exact code in production right now, and it works. 我现在在生产中使用相同的代码,并且可以正常工作。 If you want to try In App Purchase, try it on your device and create a test account in iTunes Connect. 如果要尝试在In App Purchase中进行尝试,请在您的设备上尝试并在iTunes Connect中创建一个测试帐户。 Don't rely on the simulator for this, I have mixed results with the simulator. 不要依赖模拟器,我将结果与模拟器混合在一起。

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

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