在 iOS 中使用解析和 objective-C 进行应用内购买

in app purchase in iOS using parse and objective-C

我想在 iOS 中使用 parse.com 和 objective-C.I 实现应用程序内购买,我已经在互联网上搜索过,但没有任何帮助,即使我已经没有任何方法可以开始尝试。请帮助我实施它。 非常感谢

我通常不喜欢只回答 link。主要是由于 link rot,但由于此引用来自博客,我相信它不会很快被删除。

Parse 有很好的文档记录并提供了大量开放资源,您应该始终先与他们联系,看看他们是否有任何与您手头的问题相关的文档,因为他们很可能有:

http://blog.parse.com/2012/07/24/in-app-purchase/

从博客中解释 link rot prevails 的机会:

Let’s say you want to sell a product named “Pro” that gets rid of all the ads in the app:

// First, register a handler for the product
[PFPurchase addObserverForProduct:@"Pro" block:^(SKPaymentTransaction *transaction) {
// Write business logic that should run once this product is purchased.
isPro = YES;
}];

// ... Later, when the user is purchasing the product:
[PFPurchase buyProduct:@"Pro" block:^(NSError *error) { ... }];

Parse can host your digital downloads and deliver them securely. Using the data browser, you can upload the content files to the Product class on Parse. To download the file in the app:

[PFPurchase addObserverForProduct:@"Pro" block:^(SKPaymentTransaction *transaction) {
[PFPurchase downloadAssetForTransaction:transaction completion:
        ^(NSString *filePath, NSError *error) { ... }];
}];

// ... Later, when the user is purchasing the product:
[PFPurchase buyProduct:@"Pro" block:^(NSError *error) { ... }];